]> git.karo-electronics.de Git - karo-tx-linux.git/commit
crypto: omap-sham - fix closing of hash with separate finalize call
authorTero Kristo <t-kristo@ti.com>
Wed, 24 May 2017 07:35:33 +0000 (10:35 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 10 Jun 2017 04:04:20 +0000 (12:04 +0800)
commit898d86a565925f09de3d0b30cf3b47ec2e409680
tree5f268b2016a9383af2b61a8312e6b68653f78971
parent5d78d57ede8f9e7f656c610ed25be7be337e0529
crypto: omap-sham - fix closing of hash with separate finalize call

Currently there is an interesting corner case failure with omap-sham
driver, if the finalize call is done separately with no data, but
all previous data has already been processed. In this case, it is not
possible to close the hash with the hardware without providing any data,
so we get incorrect results. Fix this by adjusting the size of data
sent to the hardware crypto engine in case the non-final data size falls
on the block size boundary, by reducing the amount of data sent by one
full block. This makes it sure that we always have some data available
for the finalize call and we can close the hash properly.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Reported-by: Aparna Balasubramanian <aparnab@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-sham.c