From: Herbert Xu Date: Wed, 21 Dec 2005 11:01:58 +0000 (+0800) Subject: [CRYPTO] sha1: Fixed off-by-64 bug in sha1_update X-Git-Tag: v2.6.16-rc1~658^2~18 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=bcb0ad2b34daade529ce1f38eede0ea8b7309535;p=~shefty%2Frdma-dev.git [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 --- 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; }