Skip to content

Commit 2fdea25

Browse files
horiagherbertx
authored andcommitted
crypto: caam - defer aead_set_sh_desc in case of zero authsize
To be able to generate shared descriptors for AEAD, the authentication size needs to be known. However, there is no imposed order of calling .setkey, .setauthsize callbacks. Thus, in case authentication size is not known at .setkey time, defer it until .setauthsize is called. The authsize != 0 check was incorrectly removed when converting the driver to the new AEAD interface. Cc: <[email protected]> # 4.3+ Fixes: 479bcc7 ("crypto: caam - Convert authenc to new AEAD interface") Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 1d2d87e commit 2fdea25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/crypto/caam/caamalg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ static int aead_set_sh_desc(struct crypto_aead *aead)
441441
OP_ALG_AAI_CTR_MOD128);
442442
const bool is_rfc3686 = alg->caam.rfc3686;
443443

444+
if (!ctx->authsize)
445+
return 0;
446+
444447
/* NULL encryption / decryption */
445448
if (!ctx->enckeylen)
446449
return aead_null_set_sh_desc(aead);

0 commit comments

Comments
 (0)