xref: /freebsd/contrib/libfido2/openbsd-compat/explicit_bzero_win32.c (revision 0afa8e065e14bb8fd338d75690e0238c00167d40)
1*0afa8e06SEd Maste /*
2*0afa8e06SEd Maste  * Public domain.
3*0afa8e06SEd Maste  * Win32 explicit_bzero compatibility shim.
4*0afa8e06SEd Maste  */
5*0afa8e06SEd Maste 
6*0afa8e06SEd Maste #include "openbsd-compat.h"
7*0afa8e06SEd Maste 
8*0afa8e06SEd Maste #if !defined(HAVE_EXPLICIT_BZERO) && defined(_WIN32)
9*0afa8e06SEd Maste 
10*0afa8e06SEd Maste #include <windows.h>
11*0afa8e06SEd Maste #include <string.h>
12*0afa8e06SEd Maste 
13*0afa8e06SEd Maste void
explicit_bzero(void * buf,size_t len)14*0afa8e06SEd Maste explicit_bzero(void *buf, size_t len)
15*0afa8e06SEd Maste {
16*0afa8e06SEd Maste 	SecureZeroMemory(buf, len);
17*0afa8e06SEd Maste }
18*0afa8e06SEd Maste 
19*0afa8e06SEd Maste #endif /* !defined(HAVE_EXPLICIT_BZERO) && defined(_WIN32) */
20