]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: qat - Fix incorrect uses of memzero_explicit
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 5 Jan 2015 20:54:41 +0000 (07:54 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 8 Jan 2015 10:46:19 +0000 (21:46 +1100)
commit7ef1b6f912dfc15591fac86cdec64671f04d8fa2
tree15a7d801cbeb7d33584b8e2a55eff0df73041fd4
parent6993938dadd0ae404b70edc8d5ec762b08a5d28a
crypto: qat - Fix incorrect uses of memzero_explicit

memzero_explicit should only be used on stack variables that get
zapped just before they go out of scope.

This patch replaces all unnecessary uses of memzero_explicit with
memset, removes two memzero_explicit calls altogether as the tfm
context comes pre-zeroed, and adds a missing memzero_explicit of
the stack variable buff in qat_alg_do_precomputes.  The memzeros
on ipad/opad + digest_size/auth_keylen are also removed as the
entire auth_state is already zeroed on entry.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Tadeusz Struk <tadeusz.struk@intel.com>
drivers/crypto/qat/qat_common/qat_algs.c