]> err.no Git - linux-2.6/commitdiff
[CRYPTO] hmac: Fix hmac_init update call
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 23 Sep 2006 14:40:41 +0000 (00:40 +1000)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 23 Sep 2006 18:34:43 +0000 (11:34 -0700)
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 <herbert@gondor.apana.org.au>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
crypto/hmac.c

index f403b6946047161db8ea6a11e023f51d9598c0cb..d52b234835cf19f0a85a6ba51dd6bba4cc686516 100644 (file)
@@ -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,