Skip to content

Commit

Permalink
cryoto: drbg - clear all temporary memory
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
smuellerDD authored and herbertx committed Apr 21, 2015
1 parent 1a92b2b commit 8e0498d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/drbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8e0498d

Please sign in to comment.