Added right implementation of explicit_bzero

This commit is contained in:
manojampalam 2016-03-21 21:49:04 -07:00
parent 936508e00c
commit 07537eb47c
4 changed files with 10 additions and 12 deletions

View File

@ -1707,8 +1707,6 @@ typedef long ssize_t;
#define HAVE_EXPLICIT_BZERO
#define explicit_bzero(p,l) memset((void *)(p),0,(size_t)(l))
#define bzero(p,l) memset((void *)(p),0,(size_t)(l))
#define WIN32_ZLIB_NO 1

View File

@ -138,3 +138,8 @@ struct iovec
size_t iov_len;
};
#define bzero(p,l) memset((void *)(p),0,(size_t)(l))
void
explicit_bzero(void *b, size_t len);

View File

@ -10,4 +10,9 @@ int usleep(unsigned int useconds)
pid_t waitpid(pid_t pid, int *status, int options) {
/* TODO - implement this*/
return 0;
}
void
explicit_bzero(void *b, size_t len) {
SecureZeroMemory(b, len);
}

View File

@ -23,14 +23,6 @@ explicit_bzero(void *p, size_t n)
#else /* HAVE_MEMSET_S */
#ifdef WIN32_FIXME
void
explicit_bzero(void *p, size_t n)
{
bzero(p, n);
}
#else
/*
* Indirect bzero through a volatile pointer to hopefully avoid
* dead-store optimisation eliminating the call.
@ -43,8 +35,6 @@ explicit_bzero(void *p, size_t n)
ssh_bzero(p, n);
}
#endif /* WIN32_FIXME */
#endif /* HAVE_MEMSET_S */
#endif /* HAVE_EXPLICIT_BZERO */