From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 682DB42E49; Tue, 11 Jul 2023 20:49:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58EC940C35; Tue, 11 Jul 2023 20:49:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 654644003C for ; Tue, 11 Jul 2023 20:49:49 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36BHER25022075; Tue, 11 Jul 2023 11:49:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=ty09X9TZk9vmgXrrXTlfEm7BxFCZ1i+89fiYE6wcXJs=; b=PslqZw1rNDrINVtTkszObOxwUyzgWZ9GJUBGhIWzvBjizAX8aIuwZERd1J3p4Td6evcO 9Rh3ZuJRedC2YuzijukCjnHt2qTzYWcb9WyiWUIs6/hl/dOZxYLThT/WsvgIRFqm9Gkd Q4orbUjvJw+JCqVzjb5e01man6vcbVvOhsuLqg5FRxs5yo8FBLKQJ01QF/iVZKzj/+m1 2FMR9zM5sZbATNi4aBel1eLSc/k12v1zJHcj5U/+PfzosveHWh1YCzNnF6IDH7y3rcjL IxRqGQCtUTTQT++7VS2f5o96hfFGEGl/dxX2oWD9FRWM7sNb5Dmy2p5IOnXZvrVVqnhf EQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3rsb9agb44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 11:49:46 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 11 Jul 2023 11:49:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 11 Jul 2023 11:49:44 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.175.191]) by maili.marvell.com (Postfix) with ESMTP id 9B4D03F7097; Tue, 11 Jul 2023 11:49:42 -0700 (PDT) From: Gowrishankar Muthukrishnan To: CC: , Akhil Goyal , Kai Ji , , Gowrishankar Muthukrishnan Subject: [PATCH] crypto/openssl: check for SM2 support in openssl 3.x lib Date: Wed, 12 Jul 2023 00:19:39 +0530 Message-ID: <05107292989669d527273e1efba6ef5427bf323c.1689100661.git.gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: tju30udVS7v2-neixt9npORS-X-2ksOf X-Proofpoint-ORIG-GUID: tju30udVS7v2-neixt9npORS-X-2ksOf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-11_10,2023-07-11_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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