mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 02:59:34 -05:00
Port to NT.
This commit is contained in:
parent
3fbee54fa5
commit
f804da9bef
3 changed files with 37 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue