aboutsummaryrefslogtreecommitdiff
path: root/contrib/pam_modules/pam_passwdqc/passwdqc_memzero.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pam_modules/pam_passwdqc/passwdqc_memzero.c')
-rw-r--r--contrib/pam_modules/pam_passwdqc/passwdqc_memzero.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/pam_modules/pam_passwdqc/passwdqc_memzero.c b/contrib/pam_modules/pam_passwdqc/passwdqc_memzero.c
new file mode 100644
index 000000000000..3a2505e76217
--- /dev/null
+++ b/contrib/pam_modules/pam_passwdqc/passwdqc_memzero.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016 by Solar Designer. See LICENSE.
+ */
+
+#ifdef _MSC_VER
+#include <windows.h>
+#else
+#include <string.h>
+#endif
+
+static void memzero(void *buf, size_t len)
+{
+#ifdef _MSC_VER
+ SecureZeroMemory(buf, len);
+#else
+ memset(buf, 0, len);
+#endif
+}
+
+void (*_passwdqc_memzero)(void *, size_t) = memzero;