[dpdk-dev] [PATCH] crypto/openssl: fix extra bytes being written at end of data

Piotr Azarewicz piotrx.t.azarewicz at intel.com
Wed Dec 7 11:45:54 CET 2016


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 at intel.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c |    2 ++
 1 file changed, 2 insertions(+)

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 @@
 	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;
 
-- 
1.7.9.5



More information about the dev mailing list