patch 'crypto/openssl: fix SM2 encryption output length' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Nov 16 23:52:09 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/18/26. 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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a7f95b5b75896d8027be11d69002245d28e2d66b
Thanks.
Luca Boccassi
---
>From a7f95b5b75896d8027be11d69002245d28e2d66b Mon Sep 17 00:00:00 2001
From: Sun Yuechi <sunyuechi at iscas.ac.cn>
Date: Mon, 26 Oct 2026 07:16:52 -0700
Subject: [PATCH] crypto/openssl: fix SM2 encryption output length
[ upstream commit 1398ab37293fda83073a64bc15c39169bbb72bfc ]
SM2 encryption passed a zero output length to EVP_PKEY_encrypt(),
which OpenSSL 3.6.3 and later reject as "buffer too small".
Query the required length first, as the RSA path does.
Fixes: 3b7d638fb11f ("crypto/openssl: support asymmetric SM2")
Signed-off-by: Sun Yuechi <sunyuechi at iscas.ac.cn>
Acked-by: Kai Ji <kai.ji at intel.com>
---
drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5bfad92b7c..d165330f74 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -2920,6 +2920,10 @@ process_openssl_sm2_op_evp(struct rte_crypto_op *cop,
if (!EVP_PKEY_CTX_set_params(cctx, eparams))
goto err_sm2;
+ if (!EVP_PKEY_encrypt(cctx, NULL, &output_len,
+ op->sm2.message.data, op->sm2.message.length))
+ goto err_sm2;
+
if (!EVP_PKEY_encrypt(cctx, op->sm2.cipher.data, &output_len,
op->sm2.message.data,
op->sm2.message.length))
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-16 22:52:18.665110669 +0000
+++ 0055-crypto-openssl-fix-SM2-encryption-output-length.patch 2026-11-16 22:52:16.496233696 +0000
@@ -1 +1 @@
-From 1398ab37293fda83073a64bc15c39169bbb72bfc Mon Sep 17 00:00:00 2001
+From a7f95b5b75896d8027be11d69002245d28e2d66b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1398ab37293fda83073a64bc15c39169bbb72bfc ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 1b33470c8f..8791186fec 100644
+index 5bfad92b7c..d165330f74 100644
@@ -23 +24 @@
-@@ -2791,6 +2791,10 @@ process_openssl_sm2_op_evp(struct rte_crypto_op *cop,
+@@ -2920,6 +2920,10 @@ process_openssl_sm2_op_evp(struct rte_crypto_op *cop,
More information about the stable
mailing list