Am Sonntag, 2. August 2020, 19:12:47 CEST schrieb t...@redhat.com:

Hi Tom,

> From: Tom Rix <t...@redhat.com>
> 
> Clang static analysis reports this error
> 
> crypto/drbg.c:441:40: warning: Division by zero
>         padlen = (inputlen + sizeof(L_N) + 1) % (drbg_blocklen(drbg));
>                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> 
> When drbg_bocklen fails it returns 0.
> 
>       if (drbg && drbg->core)
>               return drbg->core->blocklen_bytes;
>       return 0;
> 
> In many places in drbg_ctr_df drbg_bocklen is assumed to be non zero.
> So turn the assumption into a check.
> 
> Fixes: 541af946fe13 ("crypto: drbg - SP800-90A Deterministic Random Bit
> Generator")
> 
> Signed-off-by: Tom Rix <t...@redhat.com>

Thank you.

Reviewed-by: Stephan Mueller <smuel...@chronox.de>

Ciao
Stephan


Reply via email to