Message ID | 20200802171247.16558-1-trix@redhat.com |
---|---|
State | New |
Headers | show |
Series | crypto: drbg: check blocklen is non zero | expand |
diff --git a/crypto/drbg.c b/crypto/drbg.c index e99fe34cfa00..bd9a137e5473 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -420,6 +420,9 @@ static int drbg_ctr_df(struct drbg_state *drbg, size_t inputlen = 0; struct drbg_string *seed = NULL; + if (!drbg_blocklen(drbg)) + return -EINVAL; + memset(pad, 0, drbg_blocklen(drbg)); memset(iv, 0, drbg_blocklen(drbg));