DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: roy.fan.zhang@intel.com, gakhil@marvell.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	stable@dpdk.org
Subject: [PATCH v2 2/4] crypto/ipsec_mb: fix ZUC authentication verify
Date: Wed, 23 Feb 2022 16:01:14 +0000	[thread overview]
Message-ID: <20220223160116.736804-3-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20220223160116.736804-1-pablo.de.lara.guarch@intel.com>

ZUC authentication is done over multiple buffers at a time.
When authentication verification is done, multiple scratch buffers
are using to generate the tags that will be compared afterwards.
However, the same scratch buffer was used always, instead of having
different ones for each crypto operation.

Fixes: 0b133c36ad7d ("crypto/zuc: support IPsec Multi-buffer lib v0.54")
Cc: pablo.de.lara.guarch@intel.com
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/crypto/ipsec_mb/pmd_zuc.c      | 2 +-
 drivers/crypto/ipsec_mb/pmd_zuc_priv.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_zuc.c b/drivers/crypto/ipsec_mb/pmd_zuc.c
index ec83d96dfc..07cf1462d2 100644
--- a/drivers/crypto/ipsec_mb/pmd_zuc.c
+++ b/drivers/crypto/ipsec_mb/pmd_zuc.c
@@ -166,7 +166,7 @@ process_zuc_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,
 
 		hash_keys[i] = sess->pKey_hash;
 		if (sess->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY)
-			dst[i] = (uint32_t *)qp_data->temp_digest;
+			dst[i] = (uint32_t *)qp_data->temp_digest[i];
 		else
 			dst[i] = (uint32_t *)ops[i]->sym->auth.digest.data;
 
diff --git a/drivers/crypto/ipsec_mb/pmd_zuc_priv.h b/drivers/crypto/ipsec_mb/pmd_zuc_priv.h
index 46d5bfae37..76fd6758c2 100644
--- a/drivers/crypto/ipsec_mb/pmd_zuc_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_zuc_priv.h
@@ -75,7 +75,7 @@ struct zuc_session {
 
 struct zuc_qp_data {
 
-	uint8_t temp_digest[ZUC_DIGEST_LENGTH];
+	uint8_t temp_digest[ZUC_MAX_BURST][ZUC_DIGEST_LENGTH];
 	/* *< Buffers used to store the digest generated
 	 * by the driver when verifying a digest provided
 	 * by the user (using authentication verify operation)
-- 
2.25.1


  parent reply	other threads:[~2022-02-23 16:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 16:34 [PATCH 0/4] ipsec_mb fixes for ZUC algorithm Pablo de Lara
2022-02-18 16:34 ` [PATCH 1/4] crypto/ipsec_mb: check for missing operation types Pablo de Lara
2022-02-18 16:34 ` [PATCH 2/4] crypto/ipsec_mb: fix ZUC authentication verify Pablo de Lara
2022-02-18 16:34 ` [PATCH 3/4] crypto/ipsec_mb: fix crypto operation overwrite Pablo de Lara
2022-02-18 16:34 ` [PATCH 4/4] crypto/ipsec_mb: fix length and offset settings Pablo de Lara
2022-02-22 19:30   ` [EXT] " Akhil Goyal
2022-02-23 16:01 ` [PATCH v2 0/4] ipsec_mb fixes for ZUC algorithm Pablo de Lara
2022-02-23 16:01   ` [PATCH v2 1/4] crypto/ipsec_mb: check for missing operation types Pablo de Lara
2022-02-23 16:01   ` Pablo de Lara [this message]
2022-02-23 16:01   ` [PATCH v2 3/4] crypto/ipsec_mb: fix crypto operation overwrite Pablo de Lara
2022-02-23 16:01   ` [PATCH v2 4/4] crypto/ipsec_mb: fix length and offset settings Pablo de Lara
2022-02-24 10:23   ` [EXT] [PATCH v2 0/4] ipsec_mb fixes for ZUC algorithm Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223160116.736804-3-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).