From 05253b62d8bcd34511158c90ab84d3ed18a03954 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Fri, 16 Jan 2015 18:09:21 +1100 Subject: crypto: cts - Remove bogus use of seqiv The seqiv generator is completely inappropriate for cts as it's designed for IPsec algorithms. Since cts users do not actually use the IV generator we can just fall back to the default. Signed-off-by: Herbert Xu Acked-by: Maciej ?enczykowski --- crypto/cts.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'crypto/cts.c') diff --git a/crypto/cts.c b/crypto/cts.c index bd940582..6a8089c4 100644 --- a/crypto/cts.c +++ b/crypto/cts.c @@ -307,8 +307,6 @@ static struct crypto_instance *crypto_cts_alloc(struct rtattr **tb) inst->alg.cra_blkcipher.min_keysize = alg->cra_blkcipher.min_keysize; inst->alg.cra_blkcipher.max_keysize = alg->cra_blkcipher.max_keysize; - inst->alg.cra_blkcipher.geniv = "seqiv"; - inst->alg.cra_ctxsize = sizeof(struct crypto_cts_ctx); inst->alg.cra_init = crypto_cts_init_tfm; -- cgit v1.2.3 From aa3e312a9b98552a28b22fa166597b0767952ba0 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Fri, 16 Jan 2015 19:38:17 +1100 Subject: crypto: cts - Weed out non-CBC algorithms The cts algorithm as currently implemented assumes the underlying is a CBC-mode algorithm. So this patch adds a check for that to eliminate bogus combinations of cts with non-CBC modes. Signed-off-by: Herbert Xu --- crypto/cts.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crypto/cts.c') diff --git a/crypto/cts.c b/crypto/cts.c index 6a8089c4..e467ec0a 100644 --- a/crypto/cts.c +++ b/crypto/cts.c @@ -290,6 +290,9 @@ static struct crypto_instance *crypto_cts_alloc(struct rtattr **tb) if (!is_power_of_2(alg->cra_blocksize)) goto out_put_alg; + if (strncmp(alg->cra_name, "cbc(", 4)) + goto out_put_alg; + inst = crypto_alloc_instance("cts", alg); if (IS_ERR(inst)) goto out_put_alg; -- cgit v1.2.3