add win32-specific explicit_bzero implementation

This commit is contained in:
Brent Cook 2015-08-03 06:56:59 -05:00
parent 058e3ebe77
commit c66d80a438
3 changed files with 18 additions and 0 deletions

1
.gitignore vendored
View File

@ -120,6 +120,7 @@ include/openssl/*.he
!/crypto/Makefile.am.*
!/crypto/compat/arc4random.h
!/crypto/compat/b_win.c
!/crypto/compat/explicit_bzero_win.c
!/crypto/compat/posix_win.c
!/crypto/compat/bsd_asprintf.c
!/crypto/compat/inet_pton.c

View File

@ -34,8 +34,12 @@ libcompatnoopt_la_CFLAGS = -O0
libcompatnoopt_la_SOURCES =
if !HAVE_EXPLICIT_BZERO
if HOST_WIN
libcompatnoopt_la_SOURCES += compat/explicit_bzero_win.c
else
libcompatnoopt_la_SOURCES += compat/explicit_bzero.c
endif
endif
# other compatibility functions
libcompat_la_SOURCES =

View File

@ -0,0 +1,13 @@
/*
* Public domain.
* Win32 explicit_bzero compatibility shim.
*/
#include <windows.h>
#include <string.h>
void
explicit_bzero(void *buf, size_t len)
{
SecureZeroMemory(buf, len);
}