]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Aug 2015 03:52:16 +0000 (20:52 -0700)
commit71a0c1ecf7004a5949cceaa4bb1240923e9d2000
treea8a628d9cb53e1f77c189aa569f92a45ece1b356
parentb2b6e1667f52af6477f4a360cefe8c463dfb60fa
crypto: nx - Fixing SHA update bug

commit 10d87b730e1d9f1442cae6487bb3aef8632bed23 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/nx/nx-sha256.c
drivers/crypto/nx/nx-sha512.c
drivers/crypto/nx/nx.c
drivers/crypto/nx/nx.h