Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14917372ybl; Mon, 30 Dec 2019 20:44:08 -0800 (PST) X-Google-Smtp-Source: APXvYqw6iqK7XxEeEP89rahzl40ljtgAWX0xVeQoI7uQXmdj4o9eNeMwVwFCsRn3h86foOr0DK4k X-Received: by 2002:a9d:65da:: with SMTP id z26mr70212569oth.197.1577767448080; Mon, 30 Dec 2019 20:44:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577767448; cv=none; d=google.com; s=arc-20160816; b=lXwiXIpNe/hwLD6eqO8XFJOcg6xRFvTEEs0DDO0w1BB6MXSJG2DLnF3Ydt6O23fzrt h/7OYJ1OqlB+D2HR4yjyjMqKXnpjYfMzgVZzZxFMMJJQhNmVjAZapK1A1F76ggxf98Wy /IEz/QQXJm9Gy4CpMrmjjGzZDIsEYusc45twKdsyt+SUsDgaMecBn/CbjdGnGNPB3iBH +dPwjK569rf34PluqfeHHtwzx2qy05po7Vbk7391sF3hQevSjRv7AaL4U80wn4Q0Uk01 4JB6cU4RMFZuEIVH2xJ+FH2yVR3Lrn67xHLbnr0WfB5QDRP9KqXdJPVBb1MjHCXNqLxK inCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tHCWSvcwCE4mRLraWjyu45jzETRirq3t0XXIy6lvgiE=; b=yZwvB+pJZQQBU3Dp5u4fHHRBRVS7rFyj+vopt5sK/uXy/e5u/zlVUlM2sW6oXZLB0Z P7A1zEP3cHBsY/U7H8XTzwneLN7RzOaS60FbWKELbr6pL2PHQZelpGtTOqGhz4wZiHbB vL/E17SA1XQBmzi4BIif8919S4JDHzNXmvYN4EIml8Ub/9x5aAyq/ce3XMPJo/xUS0D5 6CH7qK0Tycdmvy1+9NknpOupVhBVxSkuZPSURCjevqw5KejDV8/sdI0cs6dqUp/xxBsD MU7c4jhjF93RvZR2EebwF+bK2RwM4tEpH3DcVPALUOw6NS9XTIkaYE/8SF6m8cKr4NCq wJww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=za5yRxmS; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si24867574oto.85.2019.12.30.20.43.56; Mon, 30 Dec 2019 20:44:08 -0800 (PST) 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=@kernel.org header.s=default header.b=za5yRxmS; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726416AbfLaEnz (ORCPT + 99 others); Mon, 30 Dec 2019 23:43:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:56002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbfLaEnz (ORCPT ); Mon, 30 Dec 2019 23:43:55 -0500 Received: from zzz.localdomain (h75-100-12-111.burkwi.broadband.dynamic.tds.net [75.100.12.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B5366206D9; Tue, 31 Dec 2019 04:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577767435; bh=Damv19VXLyaT1Htnt50UiVcnrVnRvBNZYwxTUDwfTqY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=za5yRxmSe6FHDzTpKPD85+AtyXpiTFFdSeG4//eCdYQ/JbgiMcHb/LuXK292GESkc o6gMMgmjF4aWq6kRxJZFnv5bcOgj1Kr20p4yES9YMBaGaoVecwoeS2d+w9SmmAsLYs /57qSG7GjYdZZagyzIVRzhMvTcyRvaobjZVClQWU= Date: Mon, 30 Dec 2019 22:43:52 -0600 From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: Jesper Nilsson , Lars Persson Subject: Re: [PATCH 2/8] crypto: artpec6 - return correct error code for failed setkey() Message-ID: <20191231044352.GB180988@zzz.localdomain> References: <20191231031938.241705-1-ebiggers@kernel.org> <20191231031938.241705-3-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191231031938.241705-3-ebiggers@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org [+Cc the people with Cc tags in the patch, who I accidentally didn't Cc... Original message was https://lkml.kernel.org/linux-crypto/20191231031938.241705-3-ebiggers@kernel.org/] On Mon, Dec 30, 2019 at 09:19:32PM -0600, Eric Biggers wrote: > From: Eric Biggers > > ->setkey() is supposed to retun -EINVAL for invalid key lengths, not -1. > > Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver") > Cc: Jesper Nilsson > Cc: Lars Persson > Signed-off-by: Eric Biggers > --- > drivers/crypto/axis/artpec6_crypto.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c > index 4b20606983a4..22ebe40f09f5 100644 > --- a/drivers/crypto/axis/artpec6_crypto.c > +++ b/drivers/crypto/axis/artpec6_crypto.c > @@ -1251,7 +1251,7 @@ static int artpec6_crypto_aead_set_key(struct crypto_aead *tfm, const u8 *key, > > if (len != 16 && len != 24 && len != 32) { > crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); > - return -1; > + return -EINVAL; > } > > ctx->key_length = len; > -- > 2.24.1 >