Commit bcb0ad2b34daade529ce1f38eede0ea8b7309535

Authored by Herbert Xu
Committed by David S. Miller
1 parent afad2608c7

[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>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -61,8 +61,8 @@
61 61 u32 temp[SHA_WORKSPACE_WORDS];
62 62  
63 63 if (partial) {
64   - done = 64 - partial;
65   - memcpy(sctx->buffer + partial, data, done);
  64 + done = -partial;
  65 + memcpy(sctx->buffer + partial, data, done + 64);
66 66 src = sctx->buffer;
67 67 }
68 68