Skip to content

Commit

Permalink
[CRYPTO] sha1: Fixed off-by-64 bug in sha1_update
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 9, 2006
1 parent afad260 commit bcb0ad2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit bcb0ad2

Please sign in to comment.