Skip to contentSkip to conversation

crypto/openssl: fix SM2 for older openssl version

PATCH Applied Ciara Power 4 participants 4 messages Jun 15, 2023 – Jun 16, 2023 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/openssl: fix SM2 for older openssl version

Currently when configuring the session for SM2 asym on OpenSSL PMD using an older OpenSSL version than 3.0, an error returns,
showing a failure status for tests.

This should skip tests, as the SM2 support is for OpenSSL version 3.0+.

Fixes 3b7d638fb11f ("crypto/openssl: support asymmetric SM2")
---
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/openssl/rte_openssl_pmd_ops.c +3 -0
index fe38e4ebd8..9497da41ef 100644
@@ -1324,6 +1324,9 @@ static int openssl_set_asym_session_parameters(
 			OSSL_PARAM_free(asym_session->u.sm2.params);
 
 		return -1;
+#else
+		OPENSSL_LOG(WARNING, "SM2 unsupported for OpenSSL Version < 3.0");
+		return -ENOTSUP;
 #endif
 	}
 	default:
Signature · 1 line
2.25.1
Acked-by Kai Ji on v1 1/1
#1 lore raw

________________________________
From: Power, Ciara <[email protected]>
Sent: 15 June 2023 09:03
To: [email protected] <[email protected]>
Cc: Power, Ciara <[email protected]>; [email protected] <[email protected]>; Ji, Kai <[email protected]>
Subject: [PATCH] crypto/openssl: fix SM2 for older openssl version

Currently when configuring the session for SM2 asym on OpenSSL PMD using an older OpenSSL version than 3.0, an error returns,
showing a failure status for tests.

This should skip tests, as the SM2 support is for OpenSSL version 3.0+.

Fixes 3b7d638fb11f ("crypto/openssl: support asymmetric SM2")
---
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/openssl/rte_openssl_pmd_ops.c +3 -0
index fe38e4ebd8..9497da41ef 100644
@@ -1324,6 +1324,9 @@ static int openssl_set_asym_session_parameters(
                         OSSL_PARAM_free(asym_session->u.sm2.params);
 
                 return -1;
+#else
+               OPENSSL_LOG(WARNING, "SM2 unsupported for OpenSSL Version < 3.0");
+               return -ENOTSUP;
 #endif
         }
         default:

--
2.25.1

Acked-by on v1 1/1
#2 lore raw
In reply to Ciara Power

Thanks,
Gowrishankar

Quoted 43 lines

-----Original Message-----
From: Ciara Power <[email protected]>
Sent: Thursday, June 15, 2023 1:33 PM
To: [email protected]
Cc: Ciara Power <[email protected]>; Gowrishankar Muthukrishnan <[email protected]>; Kai Ji <[email protected]>
Subject: [EXT] [PATCH] crypto/openssl: fix SM2 for older openssl version

External Email

----------------------------------------------------------------------
Currently when configuring the session for SM2 asym on OpenSSL PMD using an older OpenSSL version than 3.0, an error returns, showing a failure status for tests.

This should skip tests, as the SM2 support is for OpenSSL version 3.0+.

Fixes 3b7d638fb11f ("crypto/openssl: support asymmetric SM2")
---
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/openssl/rte_openssl_pmd_ops.c +3 -0
index fe38e4ebd8..9497da41ef 100644
@@ -1324,6 +1324,9 @@ static int openssl_set_asym_session_parameters(
 			OSSL_PARAM_free(asym_session->u.sm2.params);
 
 		return -1;
+#else
+		OPENSSL_LOG(WARNING, "SM2 unsupported for OpenSSL
 Version < 3.0");
+		return -ENOTSUP;
 #endif
 	}

default:
--
2.25.1

Applied
#3 lore raw
In reply to Ciara Power
Quoted 10 lines

Currently when configuring the session for SM2 asym on OpenSSL PMD using an older OpenSSL version than 3.0, an error returns,
showing a failure status for tests.

This should skip tests, as the SM2 support is for OpenSSL version 3.0+.

Fixes 3b7d638fb11f ("crypto/openssl: support asymmetric SM2")

Applied to dpdk-next-crypto
Thanks.