Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7714349ybi; Wed, 5 Jun 2019 23:51:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOxyX8ZyjzPSbG3o2j8o/dDL5DjrN6AjpJGju74gDY+FoWkeJy9QVxKA15o9aYWBRvViWV X-Received: by 2002:a62:1885:: with SMTP id 127mr52629620pfy.48.1559803892163; Wed, 05 Jun 2019 23:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559803892; cv=none; d=google.com; s=arc-20160816; b=yozOTDGMAFfKhFxKjmoKo7fpTdhA0vNkHhqlWC12hYbRnhlY6fPikn0vVWNEGHxnQ/ jlPkQ1kQd4YAlB3k45gm3Y+UwqZNX826h3Izdbm86gORmFbM6dzsWz44gOxwN5RaCnI7 6S7XZIchD2sGeOYGkfFnWFk6vxOwUGzYFzTfY8/DSRo33jH2aqDuLhmiuU0B2G4G0ETS qEE8WlS6JspK1jpMoFgZkLIABkNUTMUrVtJ5zJsMwz+qlmIqTFhWq5BAUGUCzG1Fir0l nkzzW21Bs7ZoUpF/hYS0SbIq4mRzvICPPP2ZGaO/g+ZiP5OQfeneCzlPDLsDEYryAKgx cXIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KrxexMq9qNzvrOPrpC764cNcvHbGbW09LXoCvC8VWbU=; b=GsYUvpeUy8cR4IGuVPzTLB7lXCX/3RXVxdv7W8jswConmcfDPMQ6fpotsnFVqJA2gP Dwrh4a1Yz8mTlkIV2HbImIajFLxKFm2FVsF4Q9Pu+ATsC5CqPkrliQiB7RKzebmPXTGn Wib6+QkKXP32TQvOsPeAYoVxKBL7Uy9ysfd1RKbKQlwKvv5fnVfMi66Kxm1PUnSh5osg AufqCn1QRAYy88uuBO2V8nI8qiDkG1JAQqgVecKOPBPqZhCvMDmoInJ/VbE5Zyn9Tuwb idJLbk3z+tZPh0B7JdJkjiTNIB1VrayLHixW+k4QcpFhWSGMU1SqwBjSIay01LjVu/wi ttvQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t188si1345953pgc.228.2019.06.05.23.51.19; Wed, 05 Jun 2019 23:51:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726040AbfFFGvI (ORCPT + 99 others); Thu, 6 Jun 2019 02:51:08 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:38714 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFGvI (ORCPT ); Thu, 6 Jun 2019 02:51:08 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hYmEt-0006sS-Cq; Thu, 06 Jun 2019 14:51:07 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hYmEs-0006gx-II; Thu, 06 Jun 2019 14:51:06 +0800 Date: Thu, 6 Jun 2019 14:51:06 +0800 From: Herbert Xu To: Iuliana Prodan Cc: Horia Geanta , Aymen Sghaier , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx Subject: Re: [PATCH v5 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input Message-ID: <20190606065106.5a45rlvxvme2kmja@gondor.apana.org.au> References: <1559037131-4601-1-git-send-email-iuliana.prodan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1559037131-4601-1-git-send-email-iuliana.prodan@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, May 28, 2019 at 12:52:10PM +0300, Iuliana Prodan wrote: > The problem is with the input data size sent to CAAM for encrypt/decrypt. > Pkcs1pad is failing due to pkcs1 padding done in SW starting with0x01 > instead of 0x00 0x01. > CAAM expects an input of modulus size. For this we strip the leading > zeros in case the size is more than modulus or pad the input with zeros > until the modulus size is reached. > > Signed-off-by: Iuliana Prodan > --- > Changes since V4: > - return -ENOMEM in case zero_buffer cannot be allocated. > --- > drivers/crypto/caam/caampkc.c | 89 ++++++++++++++++++++++++++++++++++--------- > drivers/crypto/caam/caampkc.h | 2 + > 2 files changed, 74 insertions(+), 17 deletions(-) All applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt