> Hello,
> 
> The Windows NT 4.0 system has the workstation service stopped.
> 
> This causes the following snippet from rand_win.c to return 0
> 
>               if (netstatget(NULL, L"LanmanWorkstation", 0, 0,
> &outbuf) == 0)
>                       {
>                       RAND_add(outbuf, sizeof(STAT_WORKSTATION_0),
> 45);
>                       netfree(outbuf);
>                       }
> 
> Add to this a large section of calls are #if 0 out due to a reported
> problem
> by Wolfgang Marczy and there isn't many places this function gets
> entropy
> from.
> 
> Any suggestions?

Why not grab some entropy from the system entropy provider?

#include <wincrypt.h>
bool GetSysEntropy(void *ptr, int len)
{
 char namebuf[512];
 HCRYPTPROV handle;
 DWORD count=500;

 if(!CryptGetDefaultProvider(PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT,
  namebuf, &count)) return false;

 if(!CryptAcquireContext(&handle, NULL, namebuf, PROV_RSA_FULL,
  CRYPT_VERIFYCONTEXT|CRYPT_SILENT)) return false;

 if(!CrytpGenRandom(handle, len (BYTE *) ptr))
 {
  CryptReleaseContext(handle, 0);
  return false;
 }

 CryptReleaseContext(handle, 0);
 return true;
}

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to