aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2015-08-03 06:56:59 -0500
committerBrent Cook <bcook@openbsd.org>2015-08-03 06:56:59 -0500
commitc66d80a4381f0b492fd62e87deb88944b77efd22 (patch)
tree6631bbd0b3ca74973331e9d75801e310b77f1fad
parent058e3ebe77db5f2ad0b84f2bb3d516fd600de56b (diff)
downloadportable-c66d80a4381f0b492fd62e87deb88944b77efd22.tar.gz
portable-c66d80a4381f0b492fd62e87deb88944b77efd22.tar.bz2
portable-c66d80a4381f0b492fd62e87deb88944b77efd22.zip
add win32-specific explicit_bzero implementation
-rw-r--r--.gitignore1
-rw-r--r--crypto/Makefile.am4
-rw-r--r--crypto/compat/explicit_bzero_win.c13
3 files changed, 18 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 7efedef..5d7c5ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -120,6 +120,7 @@ include/openssl/*.he
120!/crypto/Makefile.am.* 120!/crypto/Makefile.am.*
121!/crypto/compat/arc4random.h 121!/crypto/compat/arc4random.h
122!/crypto/compat/b_win.c 122!/crypto/compat/b_win.c
123!/crypto/compat/explicit_bzero_win.c
123!/crypto/compat/posix_win.c 124!/crypto/compat/posix_win.c
124!/crypto/compat/bsd_asprintf.c 125!/crypto/compat/bsd_asprintf.c
125!/crypto/compat/inet_pton.c 126!/crypto/compat/inet_pton.c
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index b988d77..26d30d9 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -34,8 +34,12 @@ libcompatnoopt_la_CFLAGS = -O0
34libcompatnoopt_la_SOURCES = 34libcompatnoopt_la_SOURCES =
35 35
36if !HAVE_EXPLICIT_BZERO 36if !HAVE_EXPLICIT_BZERO
37if HOST_WIN
38libcompatnoopt_la_SOURCES += compat/explicit_bzero_win.c
39else
37libcompatnoopt_la_SOURCES += compat/explicit_bzero.c 40libcompatnoopt_la_SOURCES += compat/explicit_bzero.c
38endif 41endif
42endif
39 43
40# other compatibility functions 44# other compatibility functions
41libcompat_la_SOURCES = 45libcompat_la_SOURCES =
diff --git a/crypto/compat/explicit_bzero_win.c b/crypto/compat/explicit_bzero_win.c
new file mode 100644
index 0000000..0d09d90
--- /dev/null
+++ b/crypto/compat/explicit_bzero_win.c
@@ -0,0 +1,13 @@
1/*
2 * Public domain.
3 * Win32 explicit_bzero compatibility shim.
4 */
5
6#include <windows.h>
7#include <string.h>
8
9void
10explicit_bzero(void *buf, size_t len)
11{
12 SecureZeroMemory(buf, len);
13}