Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp634047yba; Wed, 15 May 2019 07:24:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeHJDp7NbJFSmon+K/V7H/8QWL00k9SL2L/fD8HHjA4YPwMG4XDULAbhWG+sCVW1VYGxlh X-Received: by 2002:a17:902:ac1:: with SMTP id 59mr44087944plp.294.1557930269279; Wed, 15 May 2019 07:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557930269; cv=none; d=google.com; s=arc-20160816; b=ZJfntUt1Uzifyy4Wapn2uRkZGV6ldM0fnLTsrxb38DNHeAC5BKeJhUWuw5o4mCE6AU mlRtWmaMRcrrfGB71bB+Nr3GOyvNjJw3uS1M2u8ZCmylUWDACfhxXXGXPPS//gmK8cCv cMSx6YbzzwuKAKDKMGxzr0L0t+aU26qaIopoBK+WsiDG9SPKufcsJI0j132CErjn27kK teYU4Ex4qNeHl09dgs5+28CIcIVL5jNxBnKzFm3z6t3OrwOnLIWxf9FHviYNb2s5XB0X b7SSyGtXVfic4pyrvjGJuOnEPpz8itI5VQMBaZaoT6lB8Kv6300Mp5PnKnECaq9YMTK2 9+BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=SOjwZMSmfxO4wtNW6MlG9sdzVI4mtmRgijXh6zsftZk=; b=fVbirO1GVn2yFzSHVdkVzRJz4IlMeKTLUH77iY7aCfSXVk0DJr2ZvDozRwzCkroGJE Yz410J+qZWTprkW1eSXgomY8aDLiq/+PQoShAtoiddnqSYyQRVFKZRAtUfEdNk1HbA8Z bBHYooHXTXJ3WZs3VYQmU46XsuyvXNro6fje2Nc5Hi4H50Sg0YVy+ejAspBL9nZlPEFE p0gKLWwqdKyq7LiXg+t32wnKwaeTMd20tJ85zVYchPX49nGW0A/wIl9HZKWM0BuUMVjU EeuoB6J+yi4NvH4e/AYzNVg2ELI/avuWj5zZaXign/mNiYep4FAQjAHx5PC6WywcZTXi EUJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nLxXMy09; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l76si2194228pfb.199.2019.05.15.07.24.09; Wed, 15 May 2019 07:24:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nLxXMy09; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbfEOOYF (ORCPT + 99 others); Wed, 15 May 2019 10:24:05 -0400 Received: from mail-eopbgr70040.outbound.protection.outlook.com ([40.107.7.40]:35796 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726098AbfEOOYF (ORCPT ); Wed, 15 May 2019 10:24:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SOjwZMSmfxO4wtNW6MlG9sdzVI4mtmRgijXh6zsftZk=; b=nLxXMy09kmXn7KQWr5IwoOL8XtwCYHSfbcvzCP9+g/w0FQtdjZElsDtMVx0s2wbA8bIdeXwX0db0+tPU6YqYUiq9MjF8PaQo2Sqm4w/5KA4xKBTRYysXtEf+gkLLz6jX3gPxA/R53t+Mm6k7/YFEpZhb6cpzIo5ABkEcx1XXnqA= Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com (52.134.3.153) by VI1PR0402MB2911.eurprd04.prod.outlook.com (10.175.24.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.21; Wed, 15 May 2019 14:24:00 +0000 Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::dd3c:969d:89b9:f422]) by VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::dd3c:969d:89b9:f422%4]) with mapi id 15.20.1878.024; Wed, 15 May 2019 14:24:00 +0000 From: Horia Geanta To: Iuliana Prodan , Herbert Xu , Aymen Sghaier CC: "David S. Miller" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH v3] crypto: caam - strip input without changing crypto request Thread-Topic: [PATCH v3] crypto: caam - strip input without changing crypto request Thread-Index: AQHVCyaguwFNZWWr4kKcDDftCl1gCA== Date: Wed, 15 May 2019 14:24:00 +0000 Message-ID: References: <1557928856-9550-1-git-send-email-iuliana.prodan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=horia.geanta@nxp.com; x-originating-ip: [212.146.100.6] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 028d9fdb-30f7-48e0-b19b-08d6d940f97e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VI1PR0402MB2911; x-ms-traffictypediagnostic: VI1PR0402MB2911: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(39860400002)(136003)(366004)(376002)(189003)(199004)(446003)(66066001)(8676002)(66446008)(64756008)(81166006)(66556008)(66476007)(76116006)(81156014)(476003)(2906002)(9686003)(8936002)(66946007)(73956011)(6306002)(486006)(966005)(52536014)(305945005)(14454004)(86362001)(44832011)(53936002)(74316002)(55016002)(3846002)(4744005)(6116002)(5660300002)(316002)(54906003)(6436002)(110136005)(478600001)(99286004)(25786009)(53546011)(6246003)(7736002)(68736007)(229853002)(71190400001)(71200400001)(6506007)(26005)(7696005)(256004)(14444005)(4326008)(6636002)(76176011)(33656002)(102836004)(186003)(473944003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB2911;H:VI1PR0402MB3485.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: j8xNFIWTiJFpm4ByPSZLcS8DgRu4sJvfE9RbjP2fpKe+80/y++vMr3GbrqCUkeiz/MzU0MmnYeoar+G6ZEuAdD7lHDZYvNlSW0/VEe8pluK80hfn5Wt1vhpN0B6C+9SRgd7I9UA5wcolNh6ssZo37X71xBsnlKMQNjoUJZwX7KpZRX7RRkRkIMzZ8NZwLeFl4vltlzWD2iGEeltKE0p6rR9qIcqBjA5fC5Ja9cfS1W8O4FkG8u/ZFbSw6K3jjVTFSuW6uA2LuweU8SsyqIPgUiQ4xFfTdiDBdUH2ZIqsJrd/uhcz+JJW3wUTrShEpLGtnC0HbN+TuySdSsltojL6t9BeOjSKPYEacpDaSb/jTQk09kf0Ngm2NvTkRu6yiBWNbCnXLVBKesaML/PPiTY/4/gSQFBZhXNP9vJB9xelOgo= Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 028d9fdb-30f7-48e0-b19b-08d6d940f97e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 14:24:00.5437 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2911 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/15/2019 5:01 PM, Iuliana Prodan wrote:=0A= > For rsa and pkcs1pad, CAAM expects an input of modulus size.=0A= > For this we strip the leading zeros in case the size is more than modulus= .=0A= > This commit avoids modifying the crypto request while stripping zeros fro= m=0A= > input, to comply with the crypto API requirement. This is done by adding= =0A= > a fixup input pointer and length.=0A= > =0A= > Signed-off-by: Iuliana Prodan =0A= Reviewed-by: Horia Geant=E3 =0A= =0A= Herbert,=0A= =0A= Just to avoid any confusion, this should be applied on top of=0A= [v2,1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of= =0A= invalid input=0A= https://patchwork.kernel.org/patch/10944593/=0A= =0A= Thanks,=0A= Horia=0A=