]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: omap-sham - hmac calculation bug fix for sha1 base hash
authorDmitry Kasatkin <dmitry.kasatkin@nokia.com>
Wed, 20 Apr 2011 10:34:58 +0000 (13:34 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 26 Apr 2011 06:45:38 +0000 (16:45 +1000)
commit3a91ab4f764ab047b90127a5c6da85a80abe519a
tree60e3eb51fbc11e1c15a7b25c79ba8a6dd9db9f8a
parentded0e827ae78621014098d7fc55e273e761f75a9
crypto: omap-sham - hmac calculation bug fix for sha1 base hash

This patch fixes 2 hmac inter-dependent bugs.

1. "omap-sham: hash-in-progress is stored in hw format" commit introduced
optimization where temporary hash had been stored in OMAP specific format
(big endian).
For SHA1 it is different to real hash format, which is little endian.
Final HMAC value was calculated using incorrect hash.
Because CONFIG_CRYPTO_MANAGER_TESTS was disabled this error remained
unnoticed. After enabling this option, bug has been found.

2. HMAC was calculated using temporrary hash value.
For a single-request updates, temporary hash was the final one and
HMAC result was correct. But in fact only the final hash had to be used.
All crypto tests for HMAC produces only single request and
could not catch the problem. This problem is fixed here.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-sham.c