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 CA4DB43E00 for ; Fri, 5 Apr 2024 12:38:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0B06402D4; Fri, 5 Apr 2024 12:38:13 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mails.dpdk.org (Postfix) with ESMTP id 9C9F2402CE for ; Fri, 5 Apr 2024 12:38:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712313493; x=1743849493; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dqkmgM1WRs0gUaYpDFFkcftwbvmDoU0PYK5T4fi8TMI=; b=U/i5XF0xqe5GVFkUrg58H4/zJLG93jDovlintc7K5xi10Q1o9I5IjgdT 1om0EUV5ELo/2mzIqAiVBkxXHx6a+Q3TPJ25MMHvmOBEUWDIu/O92A2HC PLtmJD/QEvK1eBn4DlrwEokAwZJrOcK848fwelIcHcdhlTcaSBoHcnjOA rQdC/lqwCGdKBFqQSkRMkhbOam3Dq8wYU8kOOz13afX+ved3bUckEmikx QR/pCk+ssV7mjQk7Cc7RMYjFp50h9I718Q2vTHW8ST7dofhICyCpn/r7W QUsMGHiMuf4yOIlckJsODMmexI48Bm5PcrEecLHsq2FXEcMLuXPRH6mRF g==; X-CSE-ConnectionGUID: QO7FGfhOQNucmlLx1YynYg== X-CSE-MsgGUID: KvanYWLgReuhY0ZkmX+Vnw== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="25143485" X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="25143485" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 03:38:11 -0700 X-CSE-ConnectionGUID: /2WKuNp9TgafgV/Pjb4p1A== X-CSE-MsgGUID: QrFL18PIT96604i+ZYObrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="19573817" Received: from silpixa00401797.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.113]) by orviesa006.jf.intel.com with ESMTP; 05 Apr 2024 03:38:09 -0700 From: Ciara Power To: stable@dpdk.org Cc: Ciara Power , pablo.de.lara.guarch@intel.com, Kai Ji Subject: [PATCH 22.11] crypto/ipsec_mb: fix incorrectly setting cipher keys Date: Fri, 5 Apr 2024 10:38:03 +0000 Message-Id: <20240405103803.2785764-1-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org The encryption and decryption keys were incorrectly being reset based on authentication algorithm after already being set earlier in the code based on cipher algorithm. In cases when 3DES was used, the keys were being incorrectly overwritten. For CPU path, there is no need to have the keys set for XCBC and CMAC cases. Fixes: 010230a1543b ("crypto/aesni_mb: support Chacha20-Poly1305") Fixes: b0a37e8cd2ac ("crypto/ipsec_mb: fix cipher key setting") Fixes: a2c6d3f34f90 ("crypto/aesni_mb: support CPU crypto") Signed-off-by: Ciara Power --- Cc: pablo.de.lara.guarch@intel.com --- drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c index ac20d01937..02d419b587 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c @@ -1017,9 +1017,6 @@ set_cpu_mb_job_params(IMB_JOB *job, struct aesni_mb_session *session, job->u.XCBC._k1_expanded = session->auth.xcbc.k1_expanded; job->u.XCBC._k2 = session->auth.xcbc.k2; job->u.XCBC._k3 = session->auth.xcbc.k3; - - job->enc_keys = session->cipher.expanded_aes_keys.encode; - job->dec_keys = session->cipher.expanded_aes_keys.decode; break; case IMB_AUTH_AES_CCM: @@ -1034,8 +1031,6 @@ set_cpu_mb_job_params(IMB_JOB *job, struct aesni_mb_session *session, job->u.CMAC._key_expanded = session->auth.cmac.expkey; job->u.CMAC._skey1 = session->auth.cmac.skey1; job->u.CMAC._skey2 = session->auth.cmac.skey2; - job->enc_keys = session->cipher.expanded_aes_keys.encode; - job->dec_keys = session->cipher.expanded_aes_keys.decode; break; case IMB_AUTH_AES_GMAC: @@ -1331,24 +1326,17 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp, job->u.XCBC._k1_expanded = session->auth.xcbc.k1_expanded; job->u.XCBC._k2 = session->auth.xcbc.k2; job->u.XCBC._k3 = session->auth.xcbc.k3; - - job->enc_keys = session->cipher.expanded_aes_keys.encode; - job->dec_keys = session->cipher.expanded_aes_keys.decode; break; case IMB_AUTH_AES_CCM: job->u.CCM.aad = op->sym->aead.aad.data + 18; job->u.CCM.aad_len_in_bytes = session->aead.aad_len; - job->enc_keys = session->cipher.expanded_aes_keys.encode; - job->dec_keys = session->cipher.expanded_aes_keys.decode; break; case IMB_AUTH_AES_CMAC: job->u.CMAC._key_expanded = session->auth.cmac.expkey; job->u.CMAC._skey1 = session->auth.cmac.skey1; job->u.CMAC._skey2 = session->auth.cmac.skey2; - job->enc_keys = session->cipher.expanded_aes_keys.encode; - job->dec_keys = session->cipher.expanded_aes_keys.decode; break; case IMB_AUTH_AES_GMAC: @@ -1396,8 +1384,6 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp, job->cipher_mode = IMB_CIPHER_CHACHA20_POLY1305_SGL; job->hash_alg = IMB_AUTH_CHACHA20_POLY1305_SGL; } - job->enc_keys = session->cipher.expanded_aes_keys.encode; - job->dec_keys = session->cipher.expanded_aes_keys.encode; break; default: job->u.HMAC._hashed_auth_key_xor_ipad = -- 2.25.1