patch 'crypto/cnxk: fix ECDH public key verification' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Mon Aug 12 14:48:14 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e585a0db98dbdbed54addd2cec7db937a4a6377a
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From e585a0db98dbdbed54addd2cec7db937a4a6377a Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Sat, 15 Jun 2024 17:04:31 +0530
Subject: [PATCH] crypto/cnxk: fix ECDH public key verification
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit d29c4e0a4bea2d8aac548371115402579e6dd5f8 ]
Public key verification is applicable only for ECDH.
Incorrect check in current dequeue operation leads to
malfunction on ECDSA verification, hence added an additional check.
Fixes: baae0994fa96 ("crypto/cnxk: support ECDH")
Fixes: 5c9025583167 ("crypto/cnxk: fix CN9K ECDH public key verification")
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Anoob Joseph <anoobj at marvell.com>
---
drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 23 ++++++++++++++---------
drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 21 +++++++++++++--------
2 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index 997110e3d3..c96cf2b3a1 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -861,15 +861,20 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp,
return;
} else if (cop->type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC &&
- cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION &&
- cop->asym->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY) {
- if (likely(compcode == CPT_COMP_GOOD)) {
- if (uc_compcode == ROC_AE_ERR_ECC_POINT_NOT_ON_CURVE) {
- cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
- return;
- } else if (uc_compcode == ROC_AE_ERR_ECC_PAI) {
- cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
- return;
+ cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
+ struct cnxk_ae_sess *sess;
+
+ sess = (struct cnxk_ae_sess *)cop->asym->session;
+ if (sess->xfrm_type == RTE_CRYPTO_ASYM_XFORM_ECDH &&
+ cop->asym->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY) {
+ if (likely(compcode == CPT_COMP_GOOD)) {
+ if (uc_compcode == ROC_AE_ERR_ECC_POINT_NOT_ON_CURVE) {
+ cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
+ return;
+ } else if (uc_compcode == ROC_AE_ERR_ECC_PAI) {
+ cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
+ return;
+ }
}
}
}
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index 442cd8e5a9..eb5575b7ec 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -579,14 +579,19 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
if (res->uc_compcode == ROC_SE_ERR_GC_ICV_MISCOMPARE)
cop->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
else if (cop->type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC &&
- cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION &&
- cop->asym->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY) {
- if (res->uc_compcode == ROC_AE_ERR_ECC_POINT_NOT_ON_CURVE) {
- cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
- return;
- } else if (res->uc_compcode == ROC_AE_ERR_ECC_PAI) {
- cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
- return;
+ cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
+ struct cnxk_ae_sess *sess;
+
+ sess = (struct cnxk_ae_sess *)cop->asym->session;
+ if (sess->xfrm_type == RTE_CRYPTO_ASYM_XFORM_ECDH &&
+ cop->asym->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY) {
+ if (res->uc_compcode == ROC_AE_ERR_ECC_POINT_NOT_ON_CURVE) {
+ cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
+ return;
+ } else if (res->uc_compcode == ROC_AE_ERR_ECC_PAI) {
+ cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
+ return;
+ }
}
} else
cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-12 20:44:03.177609747 +0800
+++ 0017-crypto-cnxk-fix-ECDH-public-key-verification.patch 2024-08-12 20:44:01.915069259 +0800
@@ -1 +1 @@
-From d29c4e0a4bea2d8aac548371115402579e6dd5f8 Mon Sep 17 00:00:00 2001
+From e585a0db98dbdbed54addd2cec7db937a4a6377a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit d29c4e0a4bea2d8aac548371115402579e6dd5f8 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index 720b756001..07bd13b16d 100644
+index 997110e3d3..c96cf2b3a1 100644
@@ -25 +27 @@
-@@ -1186,15 +1186,20 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop
+@@ -861,15 +861,20 @@ cn10k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp,
@@ -56 +58 @@
-index 96a75a7797..f443cb9563 100644
+index 442cd8e5a9..eb5575b7ec 100644
@@ -59 +61 @@
-@@ -523,14 +523,19 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
+@@ -579,14 +579,19 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
More information about the stable
mailing list