diff options
author | Stephan Mueller <smueller@chronox.de> | 2015-04-17 14:54:08 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-04-21 09:14:38 +0800 |
commit | 8e0498d99f182dd06c012dfc62768e8ca0450adf (patch) | |
tree | f0fcc1eab2958f309989812113c56cf8c74728e4 | |
parent | 1a92b2ba339221a4afee43adf125fcc9a41353f7 (diff) |
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: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | crypto/drbg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/drbg.c b/crypto/drbg.c index b69409cb7e6a..8d2944fab8e8 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -487,7 +487,7 @@ static int drbg_ctr_df(struct drbg_state *drbg, out: 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)); return ret; } |