Home GnuPG
Diffusion GnuPG 2a650772b4e1

common/mischelp: use platform memory zeroing function for wipememory

Description

common/mischelp: 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'.

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.

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

Details

Provenance
jukiviliAuthored on Dec 1 2018, 12:43 PM
Parents
rG3a90efb7cf13: scd: Add strerror to new error message.
Branches
Unknown
Tags
Unknown