Diffusion GnuPG 21fdef696353

common: Use platform memory zeroing function for wipememory

Authored by jukivili on Sat, Dec 1, 12:43 PM.

Description

common: Use platform memory zeroing function for wipememory

* common/mischelp.h (wipememory): Replace macro with function
prototype.
(wipememory2): Remove.
* common/mischelp.c (wipememory): New.
* configure.ac (AC_CHECK_FUNCS): Check for 'explicit_bzero' and
remove duplicated checks.

In new wipememory function, memory is cleared through platform
provided secure memory zeroing function, SecureZeroMemory
or explicit_bzero.

If none of these is available, memset is called through
volatile function pointer to so that compiler won't optimize
away the call.

(cherry picked from commit 2a650772b4e1c78a4fd20bc88433930e5551fe9c)

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Committed
wernerWed, Dec 5, 8:23 AM
Parents
rGedeebe0a6b9a: gpg: Improve error message about failed keygrip computation.
Branches
Unknown
Tags
Unknown