crypto: ccp - memset structure fields to zero before reuse
authorHook, Gary <Gary.Hook@amd.com>
Wed, 10 Jul 2019 00:09:22 +0000 (00:09 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:36 +0000 (07:28 +0200)
commiteba522cd0cf1185599f85d69a93836ade02baf2b
tree31894c8610b4a68df121d6c0985086041676fb86
parentcdfa9f45332530647313071cf4136ddedf07a8c4
crypto: ccp - memset structure fields to zero before reuse

commit 20e833dc36355ed642d00067641a679c618303fa upstream.

The AES GCM function reuses an 'op' data structure, which members
contain values that must be cleared for each (re)use.

This fix resolves a crypto self-test failure:
alg: aead: gcm-aes-ccp encryption test failed (wrong result) on test vector 2, cfg="two even aligned splits"

Fixes: 36cf515b9bbe ("crypto: ccp - Enable support for AES GCM on v5 CCPs")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccp/ccp-ops.c