]> 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)
commit93ac9b08ddf26e825c45df3a4f77261ab9dcf165
tree4c8434bae305c92272b5ac2dc0b97b9c4714333b
parentc73d40d600eac8fef70267f82dabc5cd185106fd
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