From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
To: <dev@dpdk.org>
Cc: <anoobj@marvell.com>, Akhil Goyal <gakhil@marvell.com>,
Kai Ji <kai.ji@intel.com>, <tingtingx.liao@intel.com>,
Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Subject: [PATCH] crypto/openssl: check for SM2 support in openssl 3.x lib
Date: Wed, 12 Jul 2023 00:19:39 +0530 [thread overview]
Message-ID: <05107292989669d527273e1efba6ef5427bf323c.1689100661.git.gmuthukrishn@marvell.com> (raw)
In some version of openSSL 3 lib (for an instance, in linux
distribution), if SM2 is not supported, driver should return
error.
Fixes: 3b7d638fb11f ("crypto/openssl: support asymmetric SM2")
Bugzilla ID: 1250
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
drivers/crypto/openssl/rte_openssl_pmd_ops.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 9497da41ef..85a4fa3e55 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -1285,6 +1285,7 @@ static int openssl_set_asym_session_parameters(
case RTE_CRYPTO_ASYM_XFORM_SM2:
{
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+#ifndef OPENSSL_NO_SM2
OSSL_PARAM_BLD *param_bld = NULL;
OSSL_PARAM *params = NULL;
int ret = -1;
@@ -1324,6 +1325,10 @@ static int openssl_set_asym_session_parameters(
OSSL_PARAM_free(asym_session->u.sm2.params);
return -1;
+#else
+ OPENSSL_LOG(WARNING, "SM2 unsupported in current OpenSSL Version");
+ return -ENOTSUP;
+#endif
#else
OPENSSL_LOG(WARNING, "SM2 unsupported for OpenSSL Version < 3.0");
return -ENOTSUP;
--
2.25.1
next reply other threads:[~2023-07-11 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 18:49 Gowrishankar Muthukrishnan [this message]
2023-07-12 5:33 ` Anoob Joseph
2023-07-12 16:50 ` Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=05107292989669d527273e1efba6ef5427bf323c.1689100661.git.gmuthukrishn@marvell.com \
--to=gmuthukrishn@marvell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=kai.ji@intel.com \
--cc=tingtingx.liao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).