crypto: hash - Zap unaligned buffers
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Jul 2009 13:35:36 +0000 (21:35 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Jul 2009 13:35:36 +0000 (21:35 +0800)
commit8c32c516eb1c1f9c14d25478442137c698788975
treeba238ddbff551ac6c445e90ad9698a5aba55876a
parent500b3e3c3dc8e4845b77ae81e5b7b085ab183ce6
crypto: hash - Zap unaligned buffers

Some unaligned buffers on the stack weren't zapped properly which
may cause secret data to be leaked.  This patch fixes them by doing
a zero memset.

It is also possible for us to place random kernel stack contents
in the digest buffer if a digest operation fails.  This is fixed
by only copying if the operation succeeded.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ahash.c
crypto/shash.c