Skip to content

Commit 9d20b57

Browse files
committed
crypto: sha-s390 - Reset index after processing partial block
The partial block handling in sha-s390 is broken when we get a partial block that is followed by an update which fills it with bytes left-over. Instead of storing the newly left-over bytes at the start of the buffer, it will be stored immediately after the previous partial block. This patch fixes this by resetting the index pointer. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 1bae4ce commit 9d20b57

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎arch/s390/crypto/sha_common.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len)
3838
BUG_ON(ret != bsize);
3939
data += bsize - index;
4040
len -= bsize - index;
41+
index = 0;
4142
}
4243

4344
/* process as many blocks as possible */

0 commit comments

Comments
 (0)