Commit 2fdea258 authored by Horia Geantă's avatar Horia Geantă Committed by Herbert Xu
Browse files

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: <> # 4.3+
Fixes: 479bcc7c

 ("crypto: caam - Convert authenc to new AEAD interface")
Signed-off-by: default avatarHoria Geantă <>
Signed-off-by: default avatarHerbert Xu <>
parent 1d2d87e8
......@@ -441,6 +441,9 @@ static int aead_set_sh_desc(struct crypto_aead *aead)
const bool is_rfc3686 = alg->caam.rfc3686;
if (!ctx->authsize)
return 0;
/* NULL encryption / decryption */
if (!ctx->enckeylen)
return aead_null_set_sh_desc(aead);
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