patch 'test/crypto: fix RSA vector as per RFC 8017' has been queued to stable release 24.11.3
Kevin Traynor
ktraynor at redhat.com
Fri Jul 18 21:30:59 CEST 2025
Hi,
FYI, your patch has been queued to stable release 24.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 07/23/25. 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://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/6fe3cdedf18322a99b80382feb009586b5376be8
Thanks.
Kevin
---
>From 6fe3cdedf18322a99b80382feb009586b5376be8 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Fri, 20 Jun 2025 13:49:17 +0530
Subject: [PATCH] test/crypto: fix RSA vector as per RFC 8017
[ upstream commit 653ef76297342061b51c208412cedd46d9c71907 ]
As per RFC 8017 (A.1.2), RSA private key should be represented
with both exponent and CRT forms of data for inter operability.
Fixes: a379799cbaaf ("test/crypto: add RSA key type CRT")
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
---
app/test/test_cryptodev_asym.c | 16 ++++++++---
app/test/test_cryptodev_rsa_test_vectors.h | 32 +++++-----------------
2 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index e2f74702ad..0d47b7b299 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -236,4 +236,5 @@ test_rsa_sign_verify(void)
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
+ struct rte_crypto_asym_xform xform;
void *sess = NULL;
struct rte_cryptodev_info dev_info;
@@ -251,5 +252,8 @@ test_rsa_sign_verify(void)
}
- ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
+ memcpy(&xform, &rsa_xform, sizeof(rsa_xform));
+ xform.rsa.key_type = RTE_RSA_KEY_TYPE_EXP;
+
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
if (ret < 0) {
@@ -276,4 +280,5 @@ test_rsa_enc_dec(void)
struct rte_mempool *sess_mpool = ts_params->session_mpool;
uint8_t dev_id = ts_params->valid_devs[0];
+ struct rte_crypto_asym_xform xform;
void *sess = NULL;
struct rte_cryptodev_info dev_info;
@@ -291,5 +296,8 @@ test_rsa_enc_dec(void)
}
- ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
+ memcpy(&xform, &rsa_xform, sizeof(rsa_xform));
+ xform.rsa.key_type = RTE_RSA_KEY_TYPE_EXP;
+
+ ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess);
if (ret < 0) {
@@ -330,5 +338,5 @@ test_rsa_sign_verify_crt(void)
}
- ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
+ ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
if (ret < 0) {
@@ -370,5 +378,5 @@ test_rsa_enc_dec_crt(void)
}
- ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform_crt, sess_mpool, &sess);
+ ret = rte_cryptodev_asym_session_create(dev_id, &rsa_xform, sess_mpool, &sess);
if (ret < 0) {
diff --git a/app/test/test_cryptodev_rsa_test_vectors.h b/app/test/test_cryptodev_rsa_test_vectors.h
index 1b7b451387..9652b0d43a 100644
--- a/app/test/test_cryptodev_rsa_test_vectors.h
+++ b/app/test/test_cryptodev_rsa_test_vectors.h
@@ -341,5 +341,5 @@ uint8_t rsa_qInv[] = {
};
-/** rsa xform using exponent key */
+/** rsa xform (of QT private key type by default) */
struct rte_crypto_asym_xform rsa_xform = {
.next = NULL,
@@ -355,27 +355,4 @@ struct rte_crypto_asym_xform rsa_xform = {
.length = sizeof(rsa_e)
},
- .key_type = RTE_RSA_KEY_TYPE_EXP,
- .d = {
- .data = rsa_d,
- .length = sizeof(rsa_d)
- }
- }
-};
-
-/** rsa xform using quintuple key */
-struct rte_crypto_asym_xform rsa_xform_crt = {
- .next = NULL,
- .xform_type = RTE_CRYPTO_ASYM_XFORM_RSA,
- .rsa = {
- .padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1_5,
- .n = {
- .data = rsa_n,
- .length = sizeof(rsa_n)
- },
- .e = {
- .data = rsa_e,
- .length = sizeof(rsa_e)
- },
- .key_type = RTE_RSA_KEY_TYPE_QT,
.qt = {
.p = {
@@ -399,5 +376,10 @@ struct rte_crypto_asym_xform rsa_xform_crt = {
.length = sizeof(rsa_qInv)
},
- }
+ },
+ .d = {
+ .data = rsa_d,
+ .length = sizeof(rsa_d)
+ },
+ .key_type = RTE_RSA_KEY_TYPE_QT
}
};
--
2.50.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-07-18 20:29:15.391901810 +0100
+++ 0125-test-crypto-fix-RSA-vector-as-per-RFC-8017.patch 2025-07-18 20:29:11.072907766 +0100
@@ -1 +1 @@
-From 653ef76297342061b51c208412cedd46d9c71907 Mon Sep 17 00:00:00 2001
+From 6fe3cdedf18322a99b80382feb009586b5376be8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 653ef76297342061b51c208412cedd46d9c71907 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 46bbc520e6..87c26322d0 100644
+index e2f74702ad..0d47b7b299 100644
@@ -22,2 +23,2 @@
-@@ -261,4 +261,5 @@ test_rsa_sign_verify(void)
- struct rte_cryptodev_asym_capability_idx idx;
+@@ -236,4 +236,5 @@ test_rsa_sign_verify(void)
+ struct rte_mempool *sess_mpool = ts_params->session_mpool;
@@ -28 +29 @@
-@@ -281,5 +282,8 @@ test_rsa_sign_verify(void)
+@@ -251,5 +252,8 @@ test_rsa_sign_verify(void)
@@ -38,2 +39,2 @@
-@@ -307,4 +311,5 @@ test_rsa_enc_dec(void)
- struct rte_cryptodev_asym_capability_idx idx;
+@@ -276,4 +280,5 @@ test_rsa_enc_dec(void)
+ struct rte_mempool *sess_mpool = ts_params->session_mpool;
@@ -44 +45 @@
-@@ -327,5 +332,8 @@ test_rsa_enc_dec(void)
+@@ -291,5 +296,8 @@ test_rsa_enc_dec(void)
@@ -54 +55 @@
-@@ -372,5 +380,5 @@ test_rsa_sign_verify_crt(void)
+@@ -330,5 +338,5 @@ test_rsa_sign_verify_crt(void)
@@ -61 +62 @@
-@@ -418,5 +426,5 @@ test_rsa_enc_dec_crt(void)
+@@ -370,5 +378,5 @@ test_rsa_enc_dec_crt(void)
More information about the stable
mailing list