diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2011-02-07 04:26:06 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-02-07 04:26:06 -0500 |
commit | 9d20b571f5bda7273656e1b86ef91eddc94adacc (patch) | |
tree | 54ed61190b0710813b68fadbbd25bed47c3f31f1 /arch/s390/crypto | |
parent | 1bae4ce27c9c90344f23c65ea6966c50ffeae2f5 (diff) |
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>
Diffstat (limited to 'arch/s390/crypto')
-rw-r--r-- | arch/s390/crypto/sha_common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/s390/crypto/sha_common.c b/arch/s390/crypto/sha_common.c index f42dbabc0d30..48884f89ab92 100644 --- a/arch/s390/crypto/sha_common.c +++ b/arch/s390/crypto/sha_common.c | |||
@@ -38,6 +38,7 @@ int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len) | |||
38 | BUG_ON(ret != bsize); | 38 | BUG_ON(ret != bsize); |
39 | data += bsize - index; | 39 | data += bsize - index; |
40 | len -= bsize - index; | 40 | len -= bsize - index; |
41 | index = 0; | ||
41 | } | 42 | } |
42 | 43 | ||
43 | /* process as many blocks as possible */ | 44 | /* process as many blocks as possible */ |