diff options
author | Brent Cook <bcook@openbsd.org> | 2015-08-03 06:56:59 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2015-08-03 06:56:59 -0500 |
commit | c66d80a4381f0b492fd62e87deb88944b77efd22 (patch) | |
tree | 6631bbd0b3ca74973331e9d75801e310b77f1fad | |
parent | 058e3ebe77db5f2ad0b84f2bb3d516fd600de56b (diff) | |
download | portable-c66d80a4381f0b492fd62e87deb88944b77efd22.tar.gz portable-c66d80a4381f0b492fd62e87deb88944b77efd22.tar.bz2 portable-c66d80a4381f0b492fd62e87deb88944b77efd22.zip |
add win32-specific explicit_bzero implementation
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | crypto/Makefile.am | 4 | ||||
-rw-r--r-- | crypto/compat/explicit_bzero_win.c | 13 |
3 files changed, 18 insertions, 0 deletions
@@ -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 | |||
34 | libcompatnoopt_la_SOURCES = | 34 | libcompatnoopt_la_SOURCES = |
35 | 35 | ||
36 | if !HAVE_EXPLICIT_BZERO | 36 | if !HAVE_EXPLICIT_BZERO |
37 | if HOST_WIN | ||
38 | libcompatnoopt_la_SOURCES += compat/explicit_bzero_win.c | ||
39 | else | ||
37 | libcompatnoopt_la_SOURCES += compat/explicit_bzero.c | 40 | libcompatnoopt_la_SOURCES += compat/explicit_bzero.c |
38 | endif | 41 | endif |
42 | endif | ||
39 | 43 | ||
40 | # other compatibility functions | 44 | # other compatibility functions |
41 | libcompat_la_SOURCES = | 45 | libcompat_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 | |||
9 | void | ||
10 | explicit_bzero(void *buf, size_t len) | ||
11 | { | ||
12 | SecureZeroMemory(buf, len); | ||
13 | } | ||