]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
crypto: {blk,giv}cipher: Set has_setkey
authorBen Hutchings <ben@decadent.org.uk>
Mon, 7 Mar 2016 03:40:02 +0000 (03:40 +0000)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 8 Mar 2016 12:15:18 +0000 (12:15 +0000)
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>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
crypto/ablkcipher.c
crypto/blkcipher.c

index 5da16526c89063f59eea8767163dd7a6d1c7425b..970b48e70624cedd8c054c6e398cdd084dd62bf3 100644 (file)
@@ -457,6 +457,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 7180cb2fe0264875919b21a46eb2f19eb3bdf711..3c551d46aa3b2e2c9a93702d5b828de0bcf2a913 100644 (file)
@@ -471,6 +471,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;
 }