]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: nx - Fixing SHA update bug
authorLeonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Thu, 23 Apr 2015 20:41:43 +0000 (17:41 -0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 26 Apr 2015 06:33:19 +0000 (14:33 +0800)
commitc6b99145114b6671aa1d7a41525227d0a6336775
tree4bffed8c0ee49a629ae7805334a2e56a52fec4c8
parentf869c65f6a5dc83bd8532393f709e9af92661f87
crypto: nx - Fixing SHA update bug

Bug happens when a data size less than SHA block size is passed.
Since first attempt will be saved in buffer, second round attempt
get into two step to calculate op.inlen and op.outlen. The issue
resides in this step. A  wrong value of op.inlen and outlen was being
calculated.

This patch fix this eliminate the nx_sha_build_sg_list, that is
useless in SHA's algorithm context. Instead we call nx_build_sg_list
directly and pass a previous calculated max_sg_len to it.

Signed-off-by: Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx-sha256.c
drivers/crypto/nx/nx-sha512.c
drivers/crypto/nx/nx.c
drivers/crypto/nx/nx.h