Commit 8e0498d9 authored by Stephan Mueller's avatar Stephan Mueller Committed by Herbert Xu

cryoto: drbg - clear all temporary memory

The buffer uses for temporary data must be cleared entirely. In AES192
the used buffer is drbg_statelen(drbg) + drbg_blocklen(drbg) as
documented in the comment above drbg_ctr_df.

This patch ensures that the temp buffer is completely wiped.
Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 1a92b2ba
...@@ -487,7 +487,7 @@ static int drbg_ctr_df(struct drbg_state *drbg, ...@@ -487,7 +487,7 @@ static int drbg_ctr_df(struct drbg_state *drbg,
out: out:
memset(iv, 0, drbg_blocklen(drbg)); memset(iv, 0, drbg_blocklen(drbg));
memset(temp, 0, drbg_statelen(drbg)); memset(temp, 0, drbg_statelen(drbg) + drbg_blocklen(drbg));
memset(pad, 0, drbg_blocklen(drbg)); memset(pad, 0, drbg_blocklen(drbg));
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment