DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] crypto/openssl: include private exponent in RSA session
@ 2025-06-20  8:19 Gowrishankar Muthukrishnan
  2025-06-20  8:19 ` [PATCH 2/3] test/crypto: fix RSA test vector as per RFC 8017 Gowrishankar Muthukrishnan
  2025-06-20  8:19 ` [PATCH 3/3] test/crypto: fix RSA decrypt op validation Gowrishankar Muthukrishnan
  0 siblings, 2 replies; 3+ messages in thread
From: Gowrishankar Muthukrishnan @ 2025-06-20  8:19 UTC (permalink / raw)
  To: dev, Kai Ji, Ashish Gupta, Shally Verma, Sunila Sahu
  Cc: anoobj, Akhil Goyal, Gowrishankar Muthukrishnan, stable

If private exponent is available, it should be included within
RSA session as per RFC 8017 (A.1.2). OpenSSL 1.1.1 implementation
rely on this private exponent, to implicitly reject invalid cipher.
Hence, check if it is available for session and include it.

Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym operations")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 04e018f3df..d3aa396c76 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -1025,7 +1025,7 @@ static int openssl_set_asym_session_parameters(
 		if (rsa == NULL)
 			goto err_rsa;
 
-		if (xform->rsa.key_type == RTE_RSA_KEY_TYPE_EXP) {
+		if (xform->rsa.d.length > 0) {
 			d = BN_bin2bn(
 			(const unsigned char *)xform->rsa.d.data,
 			xform->rsa.d.length,
@@ -1034,7 +1034,9 @@ static int openssl_set_asym_session_parameters(
 				RSA_free(rsa);
 				goto err_rsa;
 			}
-		} else {
+		}
+
+		if (xform->rsa.key_type == RTE_RSA_KEY_TYPE_QT) {
 			p = BN_bin2bn((const unsigned char *)
 					xform->rsa.qt.p.data,
 					xform->rsa.qt.p.length,
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-20  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-20  8:19 [PATCH 1/3] crypto/openssl: include private exponent in RSA session Gowrishankar Muthukrishnan
2025-06-20  8:19 ` [PATCH 2/3] test/crypto: fix RSA test vector as per RFC 8017 Gowrishankar Muthukrishnan
2025-06-20  8:19 ` [PATCH 3/3] test/crypto: fix RSA decrypt op validation Gowrishankar Muthukrishnan

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).