summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/explicit_bzero_win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/explicit_bzero_win32.c')
-rw-r--r--openbsd-compat/explicit_bzero_win32.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsd-compat/explicit_bzero_win32.c b/openbsd-compat/explicit_bzero_win32.c
new file mode 100644
index 0000000..8017aff
--- /dev/null
+++ b/openbsd-compat/explicit_bzero_win32.c
@@ -0,0 +1,19 @@
+/*
+ * Public domain.
+ * Win32 explicit_bzero compatibility shim.
+ */
+
+#include "openbsd-compat.h"
+
+#if !defined(HAVE_EXPLICIT_BZERO) && defined(_WIN32)
+
+#include <windows.h>
+#include <string.h>
+
+void
+explicit_bzero(void *buf, size_t len)
+{
+ SecureZeroMemory(buf, len);
+}
+
+#endif /* !defined(HAVE_EXPLICIT_BZERO) && defined(_WIN32) */