From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 6D0D52BAF; Wed, 7 Dec 2016 11:52:38 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 07 Dec 2016 02:52:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="14811638" Received: from gklab-246-023.igk.intel.com (HELO Sent) ([10.217.246.23]) by orsmga002.jf.intel.com with SMTP; 07 Dec 2016 02:52:34 -0800 Received: by Sent (sSMTP sendmail emulation); Wed, 07 Dec 2016 11:45:57 +0100 From: Piotr Azarewicz To: pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, stable@dpdk.org Date: Wed, 7 Dec 2016 11:45:54 +0100 Message-Id: <1481107554-206879-1-git-send-email-piotrx.t.azarewicz@intel.com> X-Mailer: git-send-email 1.7.9.5 Subject: [dpdk-stable] [PATCH] crypto/openssl: fix extra bytes being written at end of data X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 10:52:39 -0000 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 --- 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