summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2016-03-07 03:40:02 +0000
committerLuis Henriques <luis.henriques@canonical.com>2016-03-08 12:15:18 +0000
commit63ce06ed7250367b3f8c8f5a51ce1c1d35b7ca74 (patch)
treeccabc4e05f87adc2ac9d0aa18f27a11da28bb21c /crypto
parenta39881d103f27702f8057051f59196375b905f6a (diff)
downloadlinux-stable-63ce06ed7250367b3f8c8f5a51ce1c1d35b7ca74.tar.gz
linux-stable-63ce06ed7250367b3f8c8f5a51ce1c1d35b7ca74.tar.bz2
linux-stable-63ce06ed7250367b3f8c8f5a51ce1c1d35b7ca74.zip
crypto: {blk,giv}cipher: Set has_setkey
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>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/ablkcipher.c1
-rw-r--r--crypto/blkcipher.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 5da16526c890..970b48e70624 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -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;
}
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index 7180cb2fe026..3c551d46aa3b 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -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;
}