Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /crypto/hmac.c

Filename:/crypto/hmac.c
Lines Added:7
Lines Deleted:5
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4  2.6.24-rc3 
(Following) 2.6.24-git1  2.6.24-git2  2.6.24-git3  2.6.24-git4  2.6.24-git5  2.6.24-git6 

Location
[  2.6.24
  [  crypto
     o  hmac.c

Patch

diff --git a/crypto/hmac.c b/crypto/hmac.c
index 8802fb6..0f05be7 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -61,7 +61,7 @@ static int hmac_setkey(struct crypto_hash *parent,
       desc.tfm = tfm;
       desc.flags = crypto_hash_get_flags(parent);
       desc.flags &= CRYPTO_TFM_REQ_MAY_SLEEP;
-      sg_set_buf(&tmp, inkey, keylen);
+      sg_init_one(&tmp, inkey, keylen);
 
       err = crypto_hash_digest(&desc, &tmp, keylen, digest);
       if (err)
@@ -96,7 +96,7 @@ static int hmac_init(struct hash_desc *pdesc)
 
    desc.tfm = ctx->child;
    desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
-   sg_set_buf(&tmp, ipad, bs);
+   sg_init_one(&tmp, ipad, bs);
 
    err = crypto_hash_init(&desc);
    if (unlikely(err))
@@ -131,7 +131,7 @@ static int hmac_final(struct hash_desc *pdesc, u8 *out)
 
    desc.tfm = ctx->child;
    desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
-   sg_set_buf(&tmp, opad, bs + ds);
+   sg_init_one(&tmp, opad, bs + ds);
 
    err = crypto_hash_final(&desc, digest);
    if (unlikely(err))
@@ -158,9 +158,11 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,
    desc.tfm = ctx->child;
    desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
 
+   sg_init_table(sg1, 2);
    sg_set_buf(sg1, ipad, bs);
-   sg1[1].page = (void *)sg;
-   sg1[1].length = 0;
+   sg_set_page(&sg1[1], (void *) sg, 0, 0);
+
+   sg_init_table(sg2, 1);
    sg_set_buf(sg2, opad, bs + ds);
 
    err = crypto_hash_digest(&desc, sg1, nbytes + bs, digest);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.