Hello,
On Monday, January 30, 2012 08:34:48 AM you wrote:
Show quoted text> Queue: Net-SSLeay
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=70713 >
>
> Hi,
>
> here is a sample code how to get 4096 random bytes from Win32 system random
> generator
>
> #include <wincrypt.h>
>
> void
> SSL_win32_CryptGenRandom()
> PREINIT:
> HCRYPTPROV hCryptProv = (HCRYPTPROV)NULL;
> BYTE pbData[4096];
> int i, datasize = 0;
> CODE:
> if(CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL,
> CRYPT_VERIFYCONTEXT)) {
> if(CryptGenRandom(hCryptProv, sizeof(pbData), pbData)) {
> datasize = sizeof(pbData);
> }
> CryptReleaseContext(hCryptProv,0);
> }
> ST(0) = sv_newmortal(); /* undef to start with */
> if (datasize >= 0)
> sv_setpvn(ST(0), pbData, datasize);
>
>
> The question is what is the best way to incorporate it into Net::SSLeay
this should built in to openssl not net-ssleay, and indeed on checking it
appears to be present in crypto/rand/rand_win.c in openssl 1.0.0, 0.9.8a etc.
Cheers.
Show quoted text>
> --
> kmx
--
Mike McCauley mikem@open.com.au
Open System Consultants Pty. Ltd
9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.open.com.au
Phone +61 7 5598-7474 Fax +61 7 5598-7070
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.