aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Ebenfeld <sven.ebenfeld@gmail.com>2016-11-07 12:51:34 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2016-11-13 04:39:28 -0500
commit83d2c9a9c17b1e9f23a3a0c24c03cd18e4b02520 (patch)
treeeedaa996841103fbe4863d8b771ce08aafefb38d
parent6d4952d9d9d4dc2bb9c0255d95a09405a1e958f7 (diff)
crypto: caam - do not register AES-XTS mode on LP units
When using AES-XTS on a Wandboard, we receive a Mode error: caam_jr 2102000.jr1: 20001311: CCB: desc idx 19: AES: Mode error. According to the Security Reference Manual, the Low Power AES units of the i.MX6 do not support the XTS mode. Therefore we must not register XTS implementations in the Crypto API. Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com> Reviewed-by: Horia Geantă <horia.geanta@nxp.com> Cc: <stable@vger.kernel.org> # 4.4+ Fixes: c6415a6016bf "crypto: caam - add support for acipher xts(aes)" Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/caam/caamalg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 156aad167cd6..f5a63ba97023 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -4583,6 +4583,15 @@ static int __init caam_algapi_init(void)
4583 if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES)) 4583 if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES))
4584 continue; 4584 continue;
4585 4585
4586 /*
4587 * Check support for AES modes not available
4588 * on LP devices.
4589 */
4590 if ((cha_vid & CHA_ID_LS_AES_MASK) == CHA_ID_LS_AES_LP)
4591 if ((alg->class1_alg_type & OP_ALG_AAI_MASK) ==
4592 OP_ALG_AAI_XTS)
4593 continue;
4594
4586 t_alg = caam_alg_alloc(alg); 4595 t_alg = caam_alg_alloc(alg);
4587 if (IS_ERR(t_alg)) { 4596 if (IS_ERR(t_alg)) {
4588 err = PTR_ERR(t_alg); 4597 err = PTR_ERR(t_alg);