mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
misc: Use SecureZeroMemory if available for explicit_bzero
Useful on Windows platforms where SecureZeroMemory is available. Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
3fa0e3959c
commit
7e1e0e5098
@@ -1057,6 +1057,8 @@ void explicit_bzero(void *s, size_t n)
|
||||
{
|
||||
#if defined(HAVE_MEMSET_S)
|
||||
memset_s(s, n, '\0', n);
|
||||
#elif defined(HAVE_SECURE_ZERO_MEMORY)
|
||||
SecureZeroMemory(s, n);
|
||||
#else
|
||||
memset(s, '\0', n);
|
||||
#if defined(HAVE_GCC_VOLATILE_MEMORY_PROTECTION)
|
||||
|
||||
Reference in New Issue
Block a user