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 D51ACA0093; Thu, 13 Jan 2022 11:34:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64F994271D; Thu, 13 Jan 2022 11:34:38 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 0E2C54271B; Thu, 13 Jan 2022 11:34:36 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20DAEw1R030398; Thu, 13 Jan 2022 02:34:36 -0800 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2177.outbound.protection.outlook.com [104.47.55.177]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3djhd4r78p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jan 2022 02:34:36 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QSDQHe5M0VIcJewGEUhKsaZ6IsOl2/8t2XhTGZvpNV+5lDOUVrXNxua4A3Xz/2x7+cewVM7Al4XUnVyAIiAlNVYrjFKqfsWFG8f/CZipGUY1LNOemkcrmrT8T2V1XwY1sTH7btjzj8sCQxhelHwA6BfhWb67gaRH924nidFx0kcVdsPCh62FCEBM4JCxQwMChDE0xVW1pRryxTMLYECfnyxx4zhVAlRDIX6SlySDj8HRjaE+GBcpMJsyWYvcdOowUYlV7M5IvNo9IbVg+ODY9EfcV9e7BvnIn1uVhzuvhiB3nHEo1PK+MJHrFN1eCEgNtLhF3W6rXSbRe2UVFlfYJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TvIlcKdv53tdDQIp+I+EDJQ0vDSUfB4hmf2IHIK3Bpg=; b=cS2tmaJNocOXDn+GAgijiERnqVx+VYs16Ehq2QkfyM4TVClhtA41EboPpcRmcYnVxzE7v/k+3I7YgK2fFCDPEa14/ir9nEzj0LM3SWlgYrSkI+dFnUqULG82Q/RwY+YMwpQqFEdd8xVP2+VaJq77oOSFdyKEo+vvhBglAFNxpnx2Tx+jB/4ZXHnxoGXFx83HohLIsLxCZiuclhfbDJv5xOnmjlHgegKmYJwyBD36Ceht193eblAlZbrhHfgCmNecYKvzOaPbrLt3r43yk4fTMGJ8Gzvb70OsrKawLOd1uhzquhdv6d5T9pvJXRXUvPI7TNHlSipfr/KG7E6KtxdNRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TvIlcKdv53tdDQIp+I+EDJQ0vDSUfB4hmf2IHIK3Bpg=; b=HvoUkOKW6RUhXdAz2xmyy9uYJs3FozzobtnIe74sEq8l55ZaLN/UAADQLcWtGoBMlVjOnNxQsg/W4ZIWip56EeZjokAqR1xGG1jJm3n28EadXETq/Pefa+vpzOX2H6dRzFZCpbmvbCMhHcxAzeGkvPDH13tlX6aEIh5uWI2Rvv4= Received: from DM5PR1801MB2074.namprd18.prod.outlook.com (2603:10b6:4:63::21) by DM5PR18MB2088.namprd18.prod.outlook.com (2603:10b6:4:b4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Thu, 13 Jan 2022 10:34:33 +0000 Received: from DM5PR1801MB2074.namprd18.prod.outlook.com ([fe80::f1e1:f3e5:d7de:e9b5]) by DM5PR1801MB2074.namprd18.prod.outlook.com ([fe80::f1e1:f3e5:d7de:e9b5%5]) with mapi id 15.20.4867.012; Thu, 13 Jan 2022 10:34:33 +0000 From: Ramkumar Balu To: "Kusztal, ArkadiuszX" , Akhil Goyal , Anoob Joseph , "Doherty, Declan" , "Zhang, Roy Fan" , Ankur Dwivedi , Tejasree Kondoj CC: "stable@dpdk.org" , "dev@dpdk.org" Subject: RE: [PATCH 2/5] crypto/openssl: fix output of RSA verify op Thread-Topic: [PATCH 2/5] crypto/openssl: fix output of RSA verify op Thread-Index: AQHX5QbxeQnjHV+kF0iXalihyIS0B6xHy5gAgBk8ciA= Date: Thu, 13 Jan 2022 10:34:33 +0000 Message-ID: References: <20211129095159.16376-1-rbalu@marvell.com> <20211129095159.16376-3-rbalu@marvell.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 585d4086-c5ad-4ca0-7028-08d9d68049ec x-ms-traffictypediagnostic: DM5PR18MB2088:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Deg00mM9XYwPQhGEZm3YCCixMH7rFPTcvDxnycvM3Xq68n6eRUB52pthL+lpunmgJJDdztrl5SdZtchiXog7SFVehDbqfWnH8dN4nWutWoq3MVzGgHMvGj3gdydpY9upIkqDglt9TaUOndQLd8nBQJaevWcX/A9tS68qkI97H6OyxMCtmsfXdcqVF45SeO6Fn+hV4TgR19ZwWg7MRkGqfjOy22jp8THslpFuhjQ+/EhvIt6oB0vJDLK7LRJ1DlvTpgclSBRxstFacC8r6TkXxZcgqy68t5AIme6gF7NSSwJCao72ctoJc3hYXVdz9r05jm/ZMDY+RHZjoHdZwmwFRTuTltZyBV/YBQBTqgbNn/r9YWoPWEYKyiCp2oOQU0ky3u1n7XRfQW6BjSAOt9jZ/wqzfAGWt6uUmJk1k0VOP/yoN/4zyUZY4/xrKZC/UgGnj4ocfi8iJd1NExY2sORkQKsGo5rKOs2P1cxe32KggMleC8Hfc+XrhF/J9dpyQdVyaeS7v8jmnkklW+IuXh8ORPaVl1ov14v7XbzAqq1Qs0fH2dO5XploD7muGdcJs9/jLlIpSihmU7QirrOo5iQEYAOJk5XJUGJ3aVLZBW09Fe13MJU+dhXcFTerqd2GhlySOaO99VuuL9GK+RiIXDA9Lk6X//nmq95bknTUZcy+T6D2f0TbRC/wqOUA6xhZhULvlm3uPsQNyophav1p8aiHyRrp1+k4BAI4mNeVR6oS8pk= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR1801MB2074.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8676002)(33656002)(4326008)(38100700002)(38070700005)(15650500001)(9686003)(6636002)(8936002)(52536014)(83380400001)(2906002)(122000001)(508600001)(110136005)(54906003)(7696005)(5660300002)(186003)(6506007)(64756008)(76116006)(316002)(86362001)(53546011)(66556008)(66946007)(55016003)(66476007)(921005)(71200400001)(66446008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DVGHAkkpxnNPzDb3YMpZaLBcCOx9J2lyxF1uoqODN5h/FW8MIl8Ky7n3nnJT?= =?us-ascii?Q?3OTCs+xEJZEYjCrT86VOf3VnQEWmmpQdDFzbdrAdX+JUkXaUKx385Qbhg2O6?= =?us-ascii?Q?4Bba1NbM/89z89dp4UEaXwTrNxKQWmx3bW9SUzIw5BLsXJLNNg4AYeL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2Qh1llW+ggljWX0Vl4XbaXB7bY?= =?us-ascii?Q?Av68Hv6ZKH1ZedEmUP/RTH+8zQP4WHroSEfSxYpmuUGNti38MSGkIGUx9bHt?= =?us-ascii?Q?agfSErint6eTzXaR+DwJCWByM0enZX+O7uXglaUFGnizcm72qVlLxPgxRc0d?= =?us-ascii?Q?7w2zBStLHzaewrJcny1N+x7/yBqVhYJdMNAM2FWBAeJQVrtJ9hDHJJ9nxiLX?= =?us-ascii?Q?0mHD3cz6LfDHzO5M62CtleIWMr9wmcLKRzMiG+9mSJDX56OChQ+5IXxRM85x?= =?us-ascii?Q?CsDYQAggEnvXM4lZysWyjTpLLQ+66EjydL6Xh1e2PZ7s2H0JcKldp105pTNu?= =?us-ascii?Q?Ts1i9Sv59kyt3Fq+sxkR9vL0vrFRtiY7q4kYNArIejDZ84U53oQxLIFNddvU?= =?us-ascii?Q?3y+gqW3rhngIU4tW9IZB6RfKEsYZh97uWYl7qigPjPQoaisb08mraYKlqbwq?= =?us-ascii?Q?GlpPN7h6fJWfFklbqjL84hSgdEJjMRaxLQxrqqxYf1IslRq7qgw8TSmJVwiN?= =?us-ascii?Q?i3a8Oiind0ctK0dI7HvrCrdtl36ivBjLvwVcUzjCja1I/cusSmP/ABmNLDD4?= =?us-ascii?Q?A8mrJptWX/thBdaQsq/chTYbvivslvkpzKIa4jgkawAHJyFUGYUWJVRSfe7p?= =?us-ascii?Q?DMtagorVwrVVVrNZ0MZHim7Jst4=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR1801MB2074.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 585d4086-c5ad-4ca0-7028-08d9d68049ec X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2022 10:34:33.1838 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vFHolzBUe1qDqVby7MP6RIMCuiqe4q/ZpJUPKIUqZmmmiO6JpMzP8yILTdHAhi0pLcW/7jmOEY+JX30mLeDOFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR18MB2088 X-Proofpoint-GUID: ffRuv0eB-wYejqRdM253xz8zCRnDkta6 X-Proofpoint-ORIG-GUID: ffRuv0eB-wYejqRdM253xz8zCRnDkta6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-13_02,2022-01-13_01,2021-12-02_01 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 Thank you for the comments. I agree that OpenSSL PMD needs a major refactor= ing in asym crypto.=20 I have asked Akhil to reject this patch series. -----Original Message----- From: Kusztal, ArkadiuszX =20 Sent: Tuesday, December 28, 2021 2:41 PM To: Ramkumar Balu ; Akhil Goyal ; An= oob Joseph ; Doherty, Declan = ; Zhang, Roy Fan ; Ankur Dwivedi ; Tejasree Kondoj Cc: stable@dpdk.org; dev@dpdk.org Subject: [EXT] RE: [PATCH 2/5] crypto/openssl: fix output of RSA verify op ---------------------------------------------------------------------- > -----Original Message----- > From: Ramkumar Balu > Sent: Monday, November 29, 2021 10:52 AM > To: Akhil Goyal ; Anoob Joseph=20 > ; Doherty, Declan ;=20 > Zhang, Roy Fan ; Ankur Dwivedi=20 > ; Tejasree Kondoj > Cc: stable@dpdk.org; dev@dpdk.org; Ramkumar > Subject: [PATCH 2/5] crypto/openssl: fix output of RSA verify op >=20 > From: Ramkumar >=20 > During RSA verify, the OpenSSL PMD fails to return the plaintext after=20 > public key decryption. > This patch fixes the OpenSSL PMD to return the decrypted plaintext in=20 > cipher.data / cipher.length fields >=20 > Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym=20 > operations") > Fixes: fe1606e0138c ("crypto/openssl: fix RSA verify operation") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ramkumar > --- > drivers/crypto/openssl/rte_openssl_pmd.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c > b/drivers/crypto/openssl/rte_openssl_pmd.c > index 5794ed8159..3ab2c3b5c1 100644 > --- a/drivers/crypto/openssl/rte_openssl_pmd.c > +++ b/drivers/crypto/openssl/rte_openssl_pmd.c > @@ -1953,12 +1953,16 @@ process_openssl_rsa_op(struct rte_crypto_op=20 > *cop, > break; >=20 > case RTE_CRYPTO_ASYM_OP_VERIFY: > - tmp =3D rte_malloc(NULL, op->rsa.sign.length, 0); > + tmp =3D op->rsa.cipher.data; > if (tmp =3D=3D NULL) { > - OPENSSL_LOG(ERR, "Memory allocation failed"); > - cop->status =3D RTE_CRYPTO_OP_STATUS_ERROR; > - break; > + tmp =3D rte_malloc(NULL, op->rsa.sign.length, 0); > + if (tmp =3D=3D NULL) { > + OPENSSL_LOG(ERR, "Memory allocation > failed"); > + cop->status =3D > RTE_CRYPTO_OP_STATUS_ERROR; > + break; > + } > } > + > ret =3D RSA_public_decrypt(op->rsa.sign.length, > op->rsa.sign.data, > tmp, [Arek] - this function is deprecated and more importantly it properly handl= e only NO_PADDING situation (no der encoding, like pre TLS 1.2). OpenSSL co= de needs major refactor in this area soon (mostly in asymmetric crypto). > @@ -1974,7 +1978,9 @@ process_openssl_rsa_op(struct rte_crypto_op *cop, > OPENSSL_LOG(ERR, "RSA sign Verification failed"); > cop->status =3D RTE_CRYPTO_OP_STATUS_ERROR; > } > - rte_free(tmp); > + op->rsa.cipher.length =3D ret; > + if (tmp !=3D op->rsa.cipher.data) > + rte_free(tmp); > break; >=20 > default: > -- > 2.17.1