Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1497263pxb; Thu, 4 Feb 2021 14:50:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJychuYWereNuhQTQ5l/6/9F6R3Cyfnpz5hyjxXKDKuIhMtj5jbBC6hE9gjQ6WO6XJEqoJXA X-Received: by 2002:a17:906:c9cc:: with SMTP id hk12mr1340873ejb.134.1612479022061; Thu, 04 Feb 2021 14:50:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612479022; cv=none; d=google.com; s=arc-20160816; b=ZJaFaTkFLDKoDY4HDeMTgF5/28weX4c4qwe6PGhW6kLWQk1f8fYpWtt0NJYS2n3kAk LpWPlutmYhanL/n0EX/AzMoCJtZceI6ptBlRPRnqKkL/FSWcWWIqlEomJx3aDAF94YyH 3aK6mkI1ZLoz2mdfq/TSD7i05IppuxT9Rp3lsh0VR1lp+/f+6/S/mTT0Q0rt6KJKd1LK /n8aC0UKll2m8VyuU7PXFGang2UQC+0g238CpIcvswdjyry9j7q9VZMoMkenIggokZUF 85v+iqYfN1w742ing2tVSagu3R4nimkN1trMgzbBf0BqBHczOgO559ugpm3ll+pRdplg 8i7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rkitfeUR1x7qT4LaotnCf83CuvaSQD0fTUSMZ33uPDE=; b=tqJtgxKcsNLF0apC+PxJTldrJdu9LKy23mqF2uzmm15m+/HqJkVISzEgrJdEj02F2T yLNFK2xXces2iW3ZQMI3Fan4n/VcdCMpKJYMcwmpYy89GDfc3yIlDkGx3HHT6mQoK9ex /7wbuPv5eyAhByXF6JHPcK9/ns5N1N11krMApQzUbwh46rWEblwE89itAWJeJUEneHnR c5Hr66qYdvuMYl99PyEiYKVQHUuPNpWq5a3AdkPOpkdx5IqCDv8OALhDcoFzkUqmafmo BY6xVXhzZRklsZ6pjQZAl9M3MLo0lEgcFcPS09DIW0oIyEKGV1AA8sG0Zgjbu0Rg/HXC cLbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d/DLtBsz"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu21si4122423edb.328.2021.02.04.14.49.47; Thu, 04 Feb 2021 14:50:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d/DLtBsz"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbhBDWtq (ORCPT + 99 others); Thu, 4 Feb 2021 17:49:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:36644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbhBDWtp (ORCPT ); Thu, 4 Feb 2021 17:49:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C00ED64DF2; Thu, 4 Feb 2021 22:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612478945; bh=7QnK/aB3P7v5IBOvtzrGKwEUFve4+Dto18dDjO+8HLk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d/DLtBszbEmXjF281wBSMYWiRZDQpWLbNB1hCBU/WmWWmI91t0lNABmwDr+X9aJP0 QhhLgwVoYvVFVA7rPv2x1DAS3u9KAJhKY0VXDKG/YQIFdeFxqEtctIoxRCiHBzvL5I V1iDbiBFQvkaVgZ/gBYdWuUNEVaUGwewKE5c1Kq6iZXrt2l0zl3zPcV7LaUnNrCRH2 Q8ljHsJEmySu7NFfshF30NTTI5pij9sWH/e9rkTUYfTG0F5XUDjQ+9ohC+qH5Gj2cj lQ6XtAD6kOmVnEE6f/aCOYRyQVswghbEb045rL4IkM0somAhSEBthahOiU+qLZw1Y2 h5jASoZtw0I4w== Date: Thu, 4 Feb 2021 14:48:41 -0800 From: Eric Biggers To: Thara Gopinath Cc: herbert@gondor.apana.org.au, davem@davemloft.net, bjorn.andersson@linaro.org, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 05/11] crypto: qce: skcipher: Return error for zero length messages Message-ID: References: <20210204214359.1993065-1-thara.gopinath@linaro.org> <20210204214359.1993065-6-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210204214359.1993065-6-thara.gopinath@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Feb 04, 2021 at 04:43:53PM -0500, Thara Gopinath wrote: > Crypto engine BAM dma does not support 0 length data. Return unsupported > if zero length messages are passed for transformation. > > Signed-off-by: Thara Gopinath > --- > drivers/crypto/qce/skcipher.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c > index de1f37ed4ee6..331b3c3a5b59 100644 > --- a/drivers/crypto/qce/skcipher.c > +++ b/drivers/crypto/qce/skcipher.c > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -260,6 +261,10 @@ static int qce_skcipher_crypt(struct skcipher_request *req, int encrypt) > rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT; > keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen; > > + /* CE does not handle 0 length messages */ > + if (!req->cryptlen) > + return -EOPNOTSUPP; > + For the algorithms in question, the correct behavior is to return 0. Aren't the tests catching that difference? - Eric