]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1b4d72c65913e2fcc276f1b411ec26c4e11c39a3
tree4c8434bae305c92272b5ac2dc0b97b9c4714333b
parent27bdc6146a5f18c44a27b11c6d14b22a14c98321
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