Re: [PATCH] crypto: ecdh - explicitly zeroize private_key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 19, 2024 at 11:51:06PM -0500, Joachim Vandersmissen wrote:
>
> diff --git a/crypto/ecdh.c b/crypto/ecdh.c
> index 80afee3234fb..ce332b39b705 100644
> --- a/crypto/ecdh.c
> +++ b/crypto/ecdh.c
> @@ -33,6 +33,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf,
>  	    params.key_size > sizeof(u64) * ctx->ndigits)
>  		return -EINVAL;
>  
> +	memzero_explicit(ctx->private_key, sizeof(ctx->private_key));

Please use memset instead of memzero_explicit unless it is actually
needed (which is not the case here).

I know there is another memzero_explicit in this function which should
also be memset so it's not your fault.

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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux