crypto: omap-sham - buffer handling fixes for hashing later
authorTero Kristo <t-kristo@ti.com>
Wed, 24 May 2017 07:35:32 +0000 (10:35 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 10 Jun 2017 04:04:19 +0000 (12:04 +0800)
commit5d78d57ede8f9e7f656c610ed25be7be337e0529
tree4c8434bae305c92272b5ac2dc0b97b9c4714333b
parentad18cc9d0f911928704cdc37f4d126853daa9e4e
crypto: omap-sham - buffer handling fixes for hashing later

Currently, the hash later code only handles the cases when we have
either new data coming in with the request or old data in the buffer,
but not the combination when we have both. Fix this by changing the
ordering of the code a bit and handling both cases properly
simultaneously if needed. Also, fix an issue with omap_sham_update
that surfaces with this fix, so that the code checks the bufcnt
instead of total data amount against buffer length to avoid any
buffer overflows.

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