summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-12-21 19:01:58 +0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-09 14:15:56 -0800
commitbcb0ad2b34daade529ce1f38eede0ea8b7309535 (patch)
tree5f09892e3031dc3c94304f563e91baa1b3438d6a /crypto
parentafad2608c766f53c79ec4ffccdb4bef660b90a89 (diff)
downloadlinux-3.10-bcb0ad2b34daade529ce1f38eede0ea8b7309535.tar.gz
linux-3.10-bcb0ad2b34daade529ce1f38eede0ea8b7309535.tar.bz2
linux-3.10-bcb0ad2b34daade529ce1f38eede0ea8b7309535.zip
[CRYPTO] sha1: Fixed off-by-64 bug in sha1_update
After a partial update, the done pointer is off to the right by 64 bytes. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/sha1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/sha1.c b/crypto/sha1.c
index 8048e2dd3c1..21571ed35b7 100644
--- a/crypto/sha1.c
+++ b/crypto/sha1.c
@@ -61,8 +61,8 @@ static void sha1_update(void *ctx, const u8 *data, unsigned int len)
u32 temp[SHA_WORKSPACE_WORDS];
if (partial) {
- done = 64 - partial;
- memcpy(sctx->buffer + partial, data, done);
+ done = -partial;
+ memcpy(sctx->buffer + partial, data, done + 64);
src = sctx->buffer;
}