Hi all, I’m using OpenSSL as a module in PHP (php_openssl),
and I need to call the CGI page may times per second but the
initialization process in RAND_poll is too slow. I’m thinking to modify OpenSSL to use the rtlGenRandom
call available in XP/2003 Server/Vista OSs (see
http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx
for comments on rtlGenRandom ) the new function likes: int RAND_poll() { if_any_error_in_block_return_old_RAND_poll() { HMODULE
hlib; BOOLEAN
(APIENTRY *rtlgenrandom)(void*,
ULONG); char
buffer[1024]; int c; hlib=(HMODULE)LoadLibrary("ADVAPI32.DLL"); tlgenrandom=(BOOLEAN (APIENTRY *)(void*,ULONG))GetProcAddress(hlib,"SystemFunction036"); for(c=0;c<1+(ENTROPY_NEEDED/sizeof(buffer));++c) { rtlgenrandom(buffer,sizeof(buffer)): RAND_add(buffer,sizeof(buffer),sizeof(buffer)); } } } a bad idea? Any
thing bad here? Thanks in advance, Adrià |
- Alternate RAND_poll for XP/2003 Server/Vista Adrià Massanet
- RE: Alternate RAND_poll for XP/2003 Server/Vista Steven Reddie
- Re: Alternate RAND_poll for XP/2003 Server/Vista Corinna Vinschen
- Re: Alternate RAND_poll for XP/2003 Server/V... Rick Jones
- Re: Alternate RAND_poll for XP/2003 Serv... Corinna Vinschen
- RE: Alternate RAND_poll for XP/2003... Steven Reddie
- Re: Alternate RAND_poll for XP/... Corinna Vinschen
- RE: Alternate RAND_poll for XP/2003 Server/Vista Adrià Massanet
- Re: Alternate RAND_poll for XP/2003 Server/Vista Jack Lloyd
- RE: Alternate RAND_poll for XP/2003 Server/V... Steven Reddie
- Re: Alternate RAND_poll for XP/2003 Serv... Jack Lloyd