summaryrefslogtreecommitdiffstats
path: root/src/include/k5-int.h
diff options
context:
space:
mode:
authorJeffrey Altman <jaltman@secure-endpoints.com>2004-07-15 07:38:09 +0000
committerJeffrey Altman <jaltman@secure-endpoints.com>2004-07-15 07:38:09 +0000
commit492e321bff67f150817dac59d9633bd17a07ccd7 (patch)
tree6583a933b3845790a09d8ce05b928f9f8f2ef9ad /src/include/k5-int.h
parenta72be1fe336ddc69a8f9fe6df9ff3ca947ac7fa0 (diff)
downloadkrb5-492e321bff67f150817dac59d9633bd17a07ccd7.tar.gz
krb5-492e321bff67f150817dac59d9633bd17a07ccd7.tar.xz
krb5-492e321bff67f150817dac59d9633bd17a07ccd7.zip
* k5-int.h: define for WIN32 the macro krb5int_zap_data to
utilize the Win32 API SecureZeroMemory which is guaranteed by Microsoft not to be optimized out by the compiler. Both memset and ZeroMemory will be optimized out by the compiler when possible. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16600 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/k5-int.h')
-rw-r--r--src/include/k5-int.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index fe7a5a113..d668f1ec9 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -672,13 +672,17 @@ krb5_error_code krb5int_pbkdf2_hmac_sha1 (const krb5_data *, unsigned long,
const krb5_data *);
/* Make this a function eventually? */
-#define krb5int_zap_data(ptr, len) memset((volatile void *)ptr, 0, len)
-#if defined(__GNUC__) && defined(__GLIBC__)
+#ifdef WIN32
+# define krb5int_zap_data(ptr, len) SecureZeroMemory(ptr, len)
+#else
+# define krb5int_zap_data(ptr, len) memset((volatile void *)ptr, 0, len)
+# if defined(__GNUC__) && defined(__GLIBC__)
/* GNU libc generates multiple bogus initialization warnings if we
pass memset a volatile pointer. The compiler should do well enough
with memset even without GNU libc's attempt at optimization. */
-#undef memset
-#endif
+# undef memset
+# endif
+#endif /* WIN32 */
#define zap(p,l) krb5int_zap_data(p,l)
/* A definition of init_state for DES based encryption systems.