Commit 96f10a62 authored by Sven Ebenfeld's avatar Sven Ebenfeld Committed by Greg Kroah-Hartman

crypto: caam - do not register AES-XTS mode on LP units

commit 83d2c9a9 upstream.

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: default avatarSven Ebenfeld <sven.ebenfeld@gmail.com>
Reviewed-by: default avatarHoria Geantă <horia.geanta@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Fixes: c6415a60 "crypto: caam - add support for acipher xts(aes)"
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 454cf79b
...@@ -4542,6 +4542,15 @@ static int __init caam_algapi_init(void) ...@@ -4542,6 +4542,15 @@ static int __init caam_algapi_init(void)
if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES)) if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES))
continue; continue;
/*
* Check support for AES modes not available
* on LP devices.
*/
if ((cha_vid & CHA_ID_LS_AES_MASK) == CHA_ID_LS_AES_LP)
if ((alg->class1_alg_type & OP_ALG_AAI_MASK) ==
OP_ALG_AAI_XTS)
continue;
t_alg = caam_alg_alloc(alg); t_alg = caam_alg_alloc(alg);
if (IS_ERR(t_alg)) { if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg); err = PTR_ERR(t_alg);
......
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