lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZwDIPF58yX8r7bQO@gondor.apana.org.au>
Date: Sat, 5 Oct 2024 13:01:48 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Chenghai Huang <huangchenghai2@...wei.com>
Cc: davem@...emloft.net, linux-kernel@...r.kernel.org,
	linux-crypto@...r.kernel.org, liulongfang@...wei.com,
	shenyang39@...wei.com, qianweili@...wei.com,
	linwenkai6@...ilicon.com, wangzhou1@...ilicon.com
Subject: Re: [PATCH 1/2] crypto: hisilicon/sec2 - fix for aead icv error

On Sun, Sep 29, 2024 at 07:26:29PM +0800, Chenghai Huang wrote:
> When the AEAD algorithm is used for encryption or decryption,
> the input authentication length varies, the hardware needs to
> obtain the input length to pass the integrity check verification.
> Currently, the driver uses a fixed authentication length,which
> causes decryption failure, so the length configuration is modified.
> In addition, the step of setting the auth length is unnecessary,
> so it was deleted from the setkey function.
> 
> Fixes: 2f072d75d1ab ("crypto: hisilicon - Add aead support on SEC2")
> Signed-off-by: Wenkai Lin <linwenkai6@...ilicon.com>
> Signed-off-by: Chenghai Huang <huangchenghai2@...wei.com>
> ---
>  drivers/crypto/hisilicon/sec2/sec.h        |   2 +-
>  drivers/crypto/hisilicon/sec2/sec_crypto.c | 114 ++++++++-------------
>  drivers/crypto/hisilicon/sec2/sec_crypto.h |  11 --
>  3 files changed, 42 insertions(+), 85 deletions(-)
> 
> diff --git a/drivers/crypto/hisilicon/sec2/sec.h b/drivers/crypto/hisilicon/sec2/sec.h
> index 410c83712e28..bd75e5b4c777 100644
> --- a/drivers/crypto/hisilicon/sec2/sec.h
> +++ b/drivers/crypto/hisilicon/sec2/sec.h
> @@ -36,6 +36,7 @@ struct sec_aead_req {
>  	dma_addr_t out_mac_dma;
>  	u8 *a_ivin;
>  	dma_addr_t a_ivin_dma;
> +	size_t authsize;
>  	struct aead_request *aead_req;
>  };
>  
> @@ -90,7 +91,6 @@ struct sec_auth_ctx {
>  	dma_addr_t a_key_dma;
>  	u8 *a_key;
>  	u8 a_key_len;
> -	u8 mac_len;
>  	u8 a_alg;
>  	bool fallback;
>  	struct crypto_shash *hash_tfm;

This makes no sense.  The authsize is an attribute of the tfm,
not the request.  Why are you moving it from the tfm context into
the request?

Cheers,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ