diff options
author | Stephan Mueller <smueller@chronox.de> | 2015-04-17 08:54:08 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-04-20 21:14:38 -0400 |
commit | 8e0498d99f182dd06c012dfc62768e8ca0450adf (patch) | |
tree | f0fcc1eab2958f309989812113c56cf8c74728e4 /crypto/drbg.c | |
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>
Diffstat (limited to 'crypto/drbg.c')
-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, | |||
487 | 487 | ||
488 | out: | 488 | out: |
489 | memset(iv, 0, drbg_blocklen(drbg)); | 489 | memset(iv, 0, drbg_blocklen(drbg)); |
490 | memset(temp, 0, drbg_statelen(drbg)); | 490 | memset(temp, 0, drbg_statelen(drbg) + drbg_blocklen(drbg)); |
491 | memset(pad, 0, drbg_blocklen(drbg)); | 491 | memset(pad, 0, drbg_blocklen(drbg)); |
492 | return ret; | 492 | return ret; |
493 | } | 493 | } |