Use explicit_bzero if available
This commit is contained in:
parent
290632a193
commit
bfeec26358
@ -355,7 +355,7 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[
|
||||
AC_CHECK_FUNCS([memset_s])
|
||||
])
|
||||
AC_CHECK_FUNCS([mlock VirtualLock])
|
||||
AC_CHECK_FUNCS([SecureZeroMemory posix_memalign])
|
||||
AC_CHECK_FUNCS([SecureZeroMemory explicit_bzero posix_memalign])
|
||||
|
||||
AC_SUBST([LIBTOOL_EXTRA_FLAGS])
|
||||
|
||||
|
@ -28,6 +28,8 @@ sodium_memzero(void * const pnt, const size_t len)
|
||||
if (memset_s(pnt, (rsize_t) len, 0, (rsize_t) len) != 0) {
|
||||
abort();
|
||||
}
|
||||
#elif defined(HAVE_EXPLICIT_BZERO)
|
||||
explicit_bzero(pnt, len);
|
||||
#else
|
||||
volatile unsigned char *pnt_ = (volatile unsigned char *) pnt;
|
||||
size_t i = (size_t) 0U;
|
||||
|
Loading…
Reference in New Issue
Block a user