Skip to content

Commit

Permalink
[CRYPTO] hmac: Fix hmac_init update call
Browse files Browse the repository at this point in the history
The crypto_hash_update call in hmac_init gave the number 1
instead of the length of the sg list in bytes.  This is a
missed conversion from the digest => hash change.

As tcrypt only tests crypto_hash_digest it didn't catch this.

Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
herbertx authored and Linus Torvalds committed Sep 23, 2006
1 parent 4c8bd7e commit 5f77043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int hmac_init(struct hash_desc *pdesc)
sg_set_buf(&tmp, ipad, bs);

return unlikely(crypto_hash_init(&desc)) ?:
crypto_hash_update(&desc, &tmp, 1);
crypto_hash_update(&desc, &tmp, bs);
}

static int hmac_update(struct hash_desc *pdesc,
Expand Down

0 comments on commit 5f77043

Please sign in to comment.