Issue getting enough entropy on Windows NT 4.0 system - Openssl

This is a discussion on Issue getting enough entropy on Windows NT 4.0 system - Openssl ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Issue getting enough entropy on Windows NT 4.0 system

  1. Issue getting enough entropy on Windows NT 4.0 system


    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?

    Thanks,
    Ray Casterline
    __________________________________________________ ____________________
    OpenSSL Project http://www.openssl.org
    User Support Mailing List openssl-users@openssl.org
    Automated List Manager majordomo@openssl.org


  2. RE: Issue getting enough entropy on Windows NT 4.0 system


    > 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
    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 majordomo@openssl.org


+ Reply to Thread