MLK-14611 Fix xcbc unkeyed registration
authorRadu Solea <radu.solea@nxp.com>
Wed, 19 Apr 2017 15:19:14 +0000 (18:19 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:03 +0000 (15:22 -0500)
AES is a keyed algorithm, XCBC-AES needs a key for operation,
this patch prevents the registration of AES-based transforms
as unkeyed operations.

Signed-off-by: Radu Solea <radu.solea@nxp.com>
drivers/crypto/caam/caamhash.c

index 7beebc7..c0fe91d 100644 (file)
@@ -2323,6 +2323,9 @@ static int __init caam_algapi_hash_init(void)
                } else
                        list_add_tail(&t_alg->entry, &hash_list);
 
+               if (alg->alg_op == OP_ALG_ALGSEL_AES)
+                       continue;
+
                /* register unkeyed version */
                t_alg = caam_hash_alloc(alg, false);
                if (IS_ERR(t_alg)) {