From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C053FA0C58; Mon, 23 Aug 2021 14:47:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 42B054014D; Mon, 23 Aug 2021 14:47:22 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 4349740042; Mon, 23 Aug 2021 14:47:19 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10084"; a="217119687" X-IronPort-AV: E=Sophos;i="5.84,344,1620716400"; d="scan'208";a="217119687" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2021 05:47:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,344,1620716400"; d="scan'208";a="514771907" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.223.86]) by fmsmga004.fm.intel.com with ESMTP; 23 Aug 2021 05:47:17 -0700 From: Ciara Power To: dev@dpdk.org Cc: stable@dpdk.org, roy.fan.zhang@intel.com, Ciara Power , pablo.de.lara.guarch@intel.com, Declan Doherty Date: Mon, 23 Aug 2021 12:47:14 +0000 Message-Id: <20210823124714.255341-1-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] crypto/openssl: fix CCM processing 0 length source X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When given a source length 0 for CCM, the encryption and decryption functions did not call the EVP_ENCRYPTUPDATE/EVP_DECRYPTUPDATE functions with a src and dst, causing some FIPS validation failures for testcases with PLen=0: process_openssl_auth_encryption_ccm() line 1131: Process openssl auth encryption ccm failed Fixes: 1a4998dc4d94 ("crypto/openssl: support AES-CCM") Cc: pablo.de.lara.guarch@intel.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index 47004337d5..37b969b916 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -1114,7 +1114,7 @@ process_openssl_auth_encryption_ccm(struct rte_mbuf *mbuf_src, int offset, if (EVP_EncryptUpdate(ctx, NULL, &len, aad + 18, aadlen) <= 0) goto process_auth_encryption_ccm_err; - if (srclen > 0) + if (srclen >= 0) if (process_openssl_encryption_update(mbuf_src, offset, &dst, srclen, ctx, 0)) goto process_auth_encryption_ccm_err; @@ -1197,7 +1197,7 @@ process_openssl_auth_decryption_ccm(struct rte_mbuf *mbuf_src, int offset, if (EVP_DecryptUpdate(ctx, NULL, &len, aad + 18, aadlen) <= 0) goto process_auth_decryption_ccm_err; - if (srclen > 0) + if (srclen >= 0) if (process_openssl_decryption_update(mbuf_src, offset, &dst, srclen, ctx, 0)) return -EFAULT; -- 2.25.1