Check for SecureZeroMemory at compile time.

This commit is contained in:
Frank Denis 2013-01-21 19:18:15 -08:00
parent 3c5c23a64b
commit 7ba8af5936
2 changed files with 5 additions and 1 deletions

View File

@ -148,6 +148,10 @@ dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN AC_C_BIGENDIAN
dnl Checks for functions and headers
AC_CHECK_FUNCS([SecureZeroMemory])
dnl Switches. dnl Switches.
AC_ARG_ENABLE(pie, AC_ARG_ENABLE(pie,

View File

@ -51,7 +51,7 @@ static Salsa20Random stream = {
static void static void
sodium_memzero(void * const pnt, const size_t size) sodium_memzero(void * const pnt, const size_t size)
{ {
#ifdef _WIN32 #ifdef HAVE_SECUREZEROMEMORY
SecureZeroMemory(pnt, size); SecureZeroMemory(pnt, size);
#else #else
volatile unsigned char *pnt_ = (volatile unsigned char *) pnt; volatile unsigned char *pnt_ = (volatile unsigned char *) pnt;