summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Azarewicz <piotrx.t.azarewicz@intel.com>2016-12-07 11:45:54 +0100
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2017-01-18 21:45:15 +0100
commit6b283a03216e120a697a0006341b3ab633e6a82c (patch)
tree65432826e36a035b59a092ef841eeefec00d52ea
parent96ec5f904590f6fb2b1c467b9094c4c8fedb8d5a (diff)
downloaddpdk-6b283a03216e120a697a0006341b3ab633e6a82c.zip
dpdk-6b283a03216e120a697a0006341b3ab633e6a82c.tar.gz
dpdk-6b283a03216e120a697a0006341b3ab633e6a82c.tar.xz
crypto/openssl: fix extra bytes written at end of data
Extra bytes are being written at end of data while process standard openssl cipher encryption. This behaviour is unexpected. This patch disable the padding feature in openssl library, which is causing the problem. Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library") Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
-rw-r--r--drivers/crypto/openssl/rte_openssl_pmd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5f8fa33..832ea1d 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -496,6 +496,8 @@ process_openssl_cipher_encrypt(uint8_t *src, uint8_t *dst,
if (EVP_EncryptInit_ex(ctx, algo, NULL, key, iv) <= 0)
goto process_cipher_encrypt_err;
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
+
if (EVP_EncryptUpdate(ctx, dst, &dstlen, src, srclen) <= 0)
goto process_cipher_encrypt_err;