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 B6B5EA034F; Tue, 28 Dec 2021 10:11:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 42D1340040; Tue, 28 Dec 2021 10:11:04 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id B5D454003C; Tue, 28 Dec 2021 10:11:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640682662; x=1672218662; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=EWX7fm0TBn5d7IK3UGx0OiEUTRfEavhhZo6oZ1UlTPA=; b=lz13u3wCWilBmO394M+J5pvk9csvJ2XQS+BCJsxo7b2VuAtPHVy6Bb5/ 0v7uRJkmd/B2Td/f4hkFjI+c1DaFq4XXEHEZMCRyJCH2HZOD2UB/NxINK xVCV7laVjtHzjYV2Owj9wA+Ng+/CD8G8P2pi1bZGjLpNdDhtO85Vx5pbT nKmpULUM1Hs1ixobrzcM5Y/Q/GswKbZiNZb4156VB2K9uRHGhTG2TQth0 sPBDK60MoeCt5KEsFHGmi78qOIDRbfGW8UVBAS7PU/vC7ddkpg1HmNTG/ mw7BIPX4atlLiu2iKbaSsylKjuQ6DrjXPobfRt6w1JEbvostRcmiakpZN Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10210"; a="241290562" X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="241290562" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2021 01:11:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,242,1635231600"; d="scan'208";a="469975166" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga006.jf.intel.com with ESMTP; 28 Dec 2021 01:11:00 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 28 Dec 2021 01:11:00 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 28 Dec 2021 01:10:59 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 28 Dec 2021 01:10:59 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 28 Dec 2021 01:10:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2ZAKv/yMSIo6UfNU5r17S944BZXN8pRM4oA+9F8slQdqPAjFAyEn+FDN/sZPlaur/39MALJjp39WTk5wkwwRg2heIBcMUsIGfYcGuNvhH3lOV2KdPZ2tQWSpQmJ2xO7m362/cD70MPqMRE3FDLHKJ8Z7kOwBT6xd/VpDRB3Co+r15t+rPWlBfflLeOl/n3rWJ0+dYBsvc2V5HvFFWgtos95O2HeKR9a3aDY2Aaiiem38AW+i6WtlM3CADebwqFhRn/IFjJ0bs3VQGBsWYrBdVowOKIQQ8eC9D03WBoYAeg9eBcftJHOMjPJpRXBkNwUaC2h9VBofC1siS3VUjZpLA== 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=xSLFjAUk37tBC1aZDsf3IyxK1r1IlAiXpSViD61qj6c=; b=mMMDhbS22nfRAp1uRTrg0ZeqRq7G/vYnrTkmD3zDPO8QCIsDhDyFkhg7BV8UlG7J530wow0FygNQXX29P5YnPYK6vCeMaJCL/OQVqENHKZ+mvIM4BWaV408bRvepEkElip1kCIL/ZHhbv2DebmpTOfOmXKJBXOLYIrRfLBrFQrrSqfW8QcPbQ8LPJ2sctMJXhU35QsUiVV7fVvaGj3D0EVwTRjfxWcez8kSf5/RCI1reoyC9z+7fjCSZaMgR2K/snRW2SIfCQhP5L5N/VDHJyHa75TzgkAGp8Nq+D3AJFIyTZXZNNDFoW/cdtINL5zs+i/45m8WJ/WX9zyOUvrK8mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB5013.namprd11.prod.outlook.com (2603:10b6:510:30::21) by PH7PR11MB5885.namprd11.prod.outlook.com (2603:10b6:510:134::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Tue, 28 Dec 2021 09:10:58 +0000 Received: from PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::119f:7b25:561b:1c72]) by PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::119f:7b25:561b:1c72%6]) with mapi id 15.20.4823.023; Tue, 28 Dec 2021 09:10:58 +0000 From: "Kusztal, ArkadiuszX" To: Ramkumar Balu , 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: AQHX5Q2z45rHUnOna0y8DWfInY54AqxHyCWA Date: Tue, 28 Dec 2021 09:10:58 +0000 Message-ID: References: <20211129095159.16376-1-rbalu@marvell.com> <20211129095159.16376-3-rbalu@marvell.com> In-Reply-To: <20211129095159.16376-3-rbalu@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bb6b7886-566b-4b2d-5fce-08d9c9e1f62d x-ms-traffictypediagnostic: PH7PR11MB5885:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BlQhK3yiylB6+OnJqgqHGZIp6OeqREXHvACs2kl5Z0aNlS7Nnt/1P13Ps+SdlFoVdPhJccJUjWlyBgJqprEYYgpvtqufTcN5KgYXITLp+MfxxVR26dH3mu3joyQmCoVuuSkH2aumBoZMLYHQenNHKFP3rWIbxnB0cP5BeKmDOZmBADreYaPPJi6TN25tIZB3v9JB1UNf5SliwQ00lugEdUOuK1U6PTAVlIg4WqBXV58oUnB/xiV600kdOvSUR9wVGxkiuIIQ42G3G2E2AhB7MuUoWSmkn/eKyv/0bS5ClRKqYysf/R4xg66mVzvCQBQdlSArTrSpf2mez+bKLfeL9Y6gsoGHO2ZrlEGA7zKX5nQ//gfRPU+0xev76P11jz2QqnFtqa6o3Nhgqqe77OsBFVO7/ZiH1FS7u30HW41VEqOvv6gJeHHoQZj9WDzrNglyWGyNXFQ6X2GJ40hb4xWyTJoii/udmVQljcKvHpifkOdcq39tzdcQX8VXTUNRoPrzJFqLbiQ9W8BriRaxnvSW3UZ73lB6kbB8wcvDZW9hdMjmW1GHjf0Pouz57flBtVpgGnNITk08IYVo7Dzyl91hmZRaf7oS6lBR3Hc+WNqELjbvNCmH1SeaTQeL5cTZSB7z2PK0UdooZIL9NPNibtIN62udan6DJAQ6TKXSMhbHTCNLrKWusul7maOYidzvBzvLeOqv9Dh4cw9+isiVfyLEjQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5013.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(33656002)(4326008)(26005)(76116006)(5660300002)(86362001)(66946007)(71200400001)(66446008)(9686003)(66556008)(8936002)(66476007)(54906003)(6506007)(82960400001)(508600001)(64756008)(8676002)(186003)(2906002)(55016003)(53546011)(316002)(38100700002)(122000001)(83380400001)(52536014)(7696005)(38070700005)(15650500001)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qem7F+VgdPvAWIoHikw18tFQ8cei4+bq7SpHg9lVBYHyiY28Fq7nROW5PQyz?= =?us-ascii?Q?GQpOb1uvZRPYAqbT5XsHmUOHy0gftijpP4u35MmNstXznnnZ2FQ02Kl7WcWj?= =?us-ascii?Q?6GEXYMKAc8BfjZPuwvfgFC8DmFLFn8vD6dQmJUuOXTXLRV8onXdRoZl11jxd?= =?us-ascii?Q?/AAYenx9UaIAmFUNdsENFuZyoGsBiDoUd5H9SUbnhoHOwgJSZj1ssARTzS1D?= =?us-ascii?Q?LfVpMdm2tigdnTNvQ7VJ2MjMIxp+F57TAjiko8aB3n0xs8Xrp9XNOGP8oNH0?= =?us-ascii?Q?9McN9jejgS5jkx2sXOixkuuVTQWm1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?Q?CRfELd4N+Xat73dBneBsfl6A1A0EFeLQtLHgnyzAjWaox+o8FWNiSxdLGwJg?= =?us-ascii?Q?rpPjsSlvtqpH8DM1M/6tIgrVovSr8SjcSgnDGAKfqTKbAArFTUGfDJBHpmru?= =?us-ascii?Q?uV8v0wd4/PaWEnOtAe6IsAzZKrqyoSuhiy/vU2Nz6rYlkhviCJIKPtmXUhne?= =?us-ascii?Q?M/1P2Aw1nRKpD+qJEBZe5oyEhoVID8K3mDv4SSq8DP2JRjCJimHjtbuimTEW?= =?us-ascii?Q?5vOCryqs5m2XuKo01oYWUCludVNrSxw+UFnFPbg4iax1u1VPpOYdkRXTR85h?= =?us-ascii?Q?omTzYTxNVvFWobS6yn9IzQdiJvyhAONmScG2IEIF0cKufeqe+R6g12m+oNma?= =?us-ascii?Q?RM2bSB/NwJ+S1/WOehqtnyLnhlDd9AyRrWf3EaBgYQuoTUxp6ITQVhj2p16o?= =?us-ascii?Q?Wa62tCfStPXbzgp6RnDZF+gDQyaJgZHXjY96orMw+ulq/+bKuLu8ub4p4yc+?= =?us-ascii?Q?tlfUvw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5013.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb6b7886-566b-4b2d-5fce-08d9c9e1f62d X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Dec 2021 09:10:58.2916 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sIzTtXIH8Q4M6D4ZS02CMBpHyqmQnhax0gbbjtx9NBqPL/EUk1cRXz5UqhkKr9hggDdWagtGEWOQW0xztM4ZbGqactEywABP9zkvQGZ/vz4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5885 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Ramkumar Balu > Sent: Monday, November 29, 2021 10:52 AM > To: Akhil Goyal ; Anoob Joseph ; > Doherty, Declan ; Zhang, Roy Fan > ; Ankur Dwivedi ; 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 pu= blic key > decryption. > This patch fixes the OpenSSL PMD to return the decrypted plaintext in > cipher.data / cipher.length fields >=20 > Fixes: 3e9d6bd447fb ("crypto/openssl: add RSA and mod asym 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 > *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