patch 'crypto/qat: fix ECDSA session handling' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Sat Dec 7 09:00:06 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/10/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=084a75515686e31358c6052839456d7b6bf2538e
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 084a75515686e31358c6052839456d7b6bf2538e Mon Sep 17 00:00:00 2001
From: Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com>
Date: Wed, 6 Nov 2024 15:14:21 +0000
Subject: [PATCH] crypto/qat: fix ECDSA session handling
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 20e633b0ca15539b682539a665e8d3dc0dc2c899 ]
Fixed a problem with setting the key in the session in the ECDSA
algorithm. Since the key is being initialized in the session for EC,
it should be reflected in the PMD session initialization function.
Fixes: badc0c6f6d6a ("cryptodev: set private and public keys in EC session")
Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com>
---
drivers/crypto/qat/qat_asym.c | 41 +++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 38c23b397b..4bc087987f 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -1337,11 +1337,48 @@ err:
return ret;
}
-static void
+static int
session_set_ec(struct qat_asym_session *qat_session,
struct rte_crypto_asym_xform *xform)
{
+ uint8_t *pkey = xform->ec.pkey.data;
+ uint8_t *q_x = xform->ec.q.x.data;
+ uint8_t *q_y = xform->ec.q.y.data;
+
+ qat_session->xform.ec.pkey.data =
+ rte_malloc(NULL, xform->ec.pkey.length, 0);
+ if (qat_session->xform.ec.pkey.length &&
+ qat_session->xform.ec.pkey.data == NULL)
+ return -ENOMEM;
+ qat_session->xform.ec.q.x.data = rte_malloc(NULL,
+ xform->ec.q.x.length, 0);
+ if (qat_session->xform.ec.q.x.length &&
+ qat_session->xform.ec.q.x.data == NULL) {
+ rte_free(qat_session->xform.ec.pkey.data);
+ return -ENOMEM;
+ }
+ qat_session->xform.ec.q.y.data = rte_malloc(NULL,
+ xform->ec.q.y.length, 0);
+ if (qat_session->xform.ec.q.y.length &&
+ qat_session->xform.ec.q.y.data == NULL) {
+ rte_free(qat_session->xform.ec.pkey.data);
+ rte_free(qat_session->xform.ec.q.x.data);
+ return -ENOMEM;
+ }
+
+ memcpy(qat_session->xform.ec.pkey.data, pkey,
+ xform->ec.pkey.length);
+ qat_session->xform.ec.pkey.length = xform->ec.pkey.length;
+ memcpy(qat_session->xform.ec.q.x.data, q_x,
+ xform->ec.q.x.length);
+ qat_session->xform.ec.q.x.length = xform->ec.q.x.length;
+ memcpy(qat_session->xform.ec.q.y.data, q_y,
+ xform->ec.q.y.length);
+ qat_session->xform.ec.q.y.length = xform->ec.q.y.length;
qat_session->xform.ec.curve_id = xform->ec.curve_id;
+
+ return 0;
+
}
int
@@ -1375,7 +1412,7 @@ qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
case RTE_CRYPTO_ASYM_XFORM_ECPM:
case RTE_CRYPTO_ASYM_XFORM_ECDH:
- session_set_ec(qat_session, xform);
+ ret = session_set_ec(qat_session, xform);
break;
case RTE_CRYPTO_ASYM_XFORM_SM2:
break;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-12-06 23:26:45.699435508 +0800
+++ 0048-crypto-qat-fix-ECDSA-session-handling.patch 2024-12-06 23:26:43.953044828 +0800
@@ -1 +1 @@
-From 20e633b0ca15539b682539a665e8d3dc0dc2c899 Mon Sep 17 00:00:00 2001
+From 084a75515686e31358c6052839456d7b6bf2538e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 20e633b0ca15539b682539a665e8d3dc0dc2c899 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -19 +21 @@
-index 7bb2f6c1e0..f5b56b2f71 100644
+index 38c23b397b..4bc087987f 100644
@@ -22 +24 @@
-@@ -1348,11 +1348,48 @@ err:
+@@ -1337,11 +1337,48 @@ err:
@@ -72 +74 @@
-@@ -1388,7 +1425,7 @@ qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
+@@ -1375,7 +1412,7 @@ qat_asym_session_configure(struct rte_cryptodev *dev __rte_unused,
More information about the stable
mailing list