]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - crypto/hmac.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[karo-tx-linux.git] / crypto / hmac.c
index 44187c5ee5933cbf9195ec799d337053ef0e0b8e..e4eb6ac53b5c0b68e01643ce0ec2be97bca35939 100644 (file)
@@ -159,7 +159,8 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,
        desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
 
        sg_set_buf(sg1, ipad, bs);
-       sg1[1].page = (void *)sg;
+
+       sg_set_page(&sg[1], (void *) sg);
        sg1[1].length = 0;
        sg_set_buf(sg2, opad, bs + ds);
 
@@ -197,13 +198,18 @@ static void hmac_free(struct crypto_instance *inst)
        kfree(inst);
 }
 
-static struct crypto_instance *hmac_alloc(void *param, unsigned int len)
+static struct crypto_instance *hmac_alloc(struct rtattr **tb)
 {
        struct crypto_instance *inst;
        struct crypto_alg *alg;
+       int err;
+
+       err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_HASH);
+       if (err)
+               return ERR_PTR(err);
 
-       alg = crypto_get_attr_alg(param, len, CRYPTO_ALG_TYPE_HASH,
-                                 CRYPTO_ALG_TYPE_HASH_MASK | CRYPTO_ALG_ASYNC);
+       alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_HASH,
+                                 CRYPTO_ALG_TYPE_HASH_MASK);
        if (IS_ERR(alg))
                return ERR_PTR(PTR_ERR(alg));