]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: caam - defer aead_set_sh_desc in case of zero authsize
authorHoria Geantă <horia.geanta@nxp.com>
Thu, 4 Aug 2016 17:02:47 +0000 (20:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2016 06:34:45 +0000 (08:34 +0200)
commit24d5f2420a327696585d092c4cdb59eb527dbc63
treef32b432877860abc951895b79b537669e49f712d
parentcf84cfceb14405d8a3b1a8b774957db17bdb3e1a
crypto: caam - defer aead_set_sh_desc in case of zero authsize

commit 2fdea258fde036a87d3396ec9c0ef66f10768530 upstream.

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.

Fixes: 479bcc7c5b9e ("crypto: caam - Convert authenc to new AEAD interface")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/caam/caamalg.c