)
AC_CHECK_FUNCS(prctl mallinfo getpass closefrom getpwnam_r getgrnam_r getpwuid_r)
-AC_CHECK_FUNCS(fmemopen funopen mmap memrchr setlinebuf strptime dirfd sigwaitinfo)
+AC_CHECK_FUNCS(fmemopen funopen mmap memrchr setlinebuf strptime dirfd sigwaitinfo explicit_bzero)
AC_CHECK_FUNC([syslog], [
AC_DEFINE([HAVE_SYSLOG], [], [have syslog(3) and friends])
#ifndef MEMORY_H_
#define MEMORY_H_
+#ifdef HAVE_EXPLICIT_BZERO
+#include <string.h>
+#endif
+
/**
* Helper function that compares two binary blobs for equality
*/
*/
void memxor(uint8_t dest[], const uint8_t src[], size_t n);
+#ifdef HAVE_EXPLICIT_BZERO
+#define memwipe(ptr, n) explicit_bzero(ptr, n)
+#else /* HAVE_EXPLICIT_BZERO */
/**
* Safely overwrite n bytes of memory at ptr with zero, non-inlining variant.
*/
memwipe_noinline(ptr, n);
}
}
+#endif /* HAVE_EXPLICIT_BZERO */
/**
* A variant of strstr with the characteristics of memchr, where haystack is not