Skip to content
Snippets Groups Projects
Commit f804da9b authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Port to NT.

parent 3fbee54f
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,9 @@ typedef char * caddr_t;
/* we have <process.h> */
#define HAVE_PROCESS_H 1
/* we have <wincrypt.h> */
#define HAVE_WINCRYPT_H 1
#define LDAP_SIGUSR1 SIGILL
#define LDAP_SIGUSR2 SIGTERM
......
......@@ -6,6 +6,16 @@
#include "portable.h"
#include <ac/string.h>
#include <ac/time.h>
#ifdef HAVE_WINCRYPT_H
#include <wincrypt.h>
#endif
#ifdef HAVE_PROCESS_H
#include <process.h>
#endif
#include <fcntl.h>
#include <lutil.h>
......@@ -35,6 +45,26 @@ int lutil_entropy( char *buf, int nbytes )
/* should return nbytes */
if( rc < nbytes ) return -1;
return 0;
}
#elif PROV_RSA_FULL
{
/* Not used since _WIN32_WINNT not set... */
HCRYPTPROV hProv = 0;
/* Get handle to user default provider */
if(!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0)) {
return -1;
}
/* Generate random initialization vector */
if(!CryptGenRandom(hProv, (DWORD) nbytes, (BYTE *) buf)) {
return -1;
}
/* Release provider handle */
if(hProv != 0) CryptReleaseContext(hProv, 0);
return 0;
}
#else
......
......@@ -136,6 +136,10 @@ SOURCE=.\debug.c
# End Source File
# Begin Source File
SOURCE=.\entropy.c
# End Source File
# Begin Source File
SOURCE="..\..\include\getopt-compat.h"
# End Source File
# Begin Source File
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment