]> git.itanic.dy.fi Git - linux-stable/commitdiff
crypto: {blk,giv}cipher: Set has_setkey
authorBen Hutchings <ben@decadent.org.uk>
Sun, 6 Mar 2016 19:52:46 +0000 (19:52 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 1 Apr 2016 00:54:31 +0000 (01:54 +0100)
Commit a1383cd86a06 ("crypto: skcipher - Add crypto_skcipher_has_setkey")
was incorrectly backported to the 3.2.y and 3.16.y stable branches.
We need to set ablkcipher_tfm::has_setkey in the
crypto_init_blkcipher_ops_async() and crypto_init_givcipher_ops()
functions as well as crypto_init_ablkcipher_ops().

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
crypto/ablkcipher.c
crypto/blkcipher.c

index 6600a2a15b6b2c47a393ab0541fd7e6b4d5cedbf..3ad43ad6586eae8af6e881950783f6191e47c77d 100644 (file)
@@ -461,6 +461,7 @@ static int crypto_init_givcipher_ops(struct crypto_tfm *tfm, u32 type,
        crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt;
        crt->base = __crypto_ablkcipher_cast(tfm);
        crt->ivsize = alg->ivsize;
+       crt->has_setkey = alg->max_keysize;
 
        return 0;
 }
index 3041504370b1b964d4e2d550b7a9b15fffa7fa15..7b69d7a902a92349861a473045f6f8c8c07e06fa 100644 (file)
@@ -458,6 +458,7 @@ static int crypto_init_blkcipher_ops_async(struct crypto_tfm *tfm)
        }
        crt->base = __crypto_ablkcipher_cast(tfm);
        crt->ivsize = alg->ivsize;
+       crt->has_setkey = alg->max_keysize;
 
        return 0;
 }