Commit 63ce06ed authored by Ben Hutchings's avatar Ben Hutchings Committed by Luis Henriques

crypto: {blk,giv}cipher: Set has_setkey

Commit a1383cd8 ("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: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent a39881d1
...@@ -457,6 +457,7 @@ static int crypto_init_givcipher_ops(struct crypto_tfm *tfm, u32 type, ...@@ -457,6 +457,7 @@ static int crypto_init_givcipher_ops(struct crypto_tfm *tfm, u32 type,
crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt; crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt;
crt->base = __crypto_ablkcipher_cast(tfm); crt->base = __crypto_ablkcipher_cast(tfm);
crt->ivsize = alg->ivsize; crt->ivsize = alg->ivsize;
crt->has_setkey = alg->max_keysize;
return 0; return 0;
} }
......
...@@ -471,6 +471,7 @@ static int crypto_init_blkcipher_ops_async(struct crypto_tfm *tfm) ...@@ -471,6 +471,7 @@ static int crypto_init_blkcipher_ops_async(struct crypto_tfm *tfm)
} }
crt->base = __crypto_ablkcipher_cast(tfm); crt->base = __crypto_ablkcipher_cast(tfm);
crt->ivsize = alg->ivsize; crt->ivsize = alg->ivsize;
crt->has_setkey = alg->max_keysize;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment