We were using OpenSSL in our product, but lately after testing on Vista, our application was was crashing (only in Vista) in SSL_Connect(). (It worked fine in XP)

After debugging through OpenSSL we found that within RAND_poll() it was crashing in a win32 api function snap(TH32CS_SNAPALL,0).
...
Has anyone else faced such RAND_poll() related crash before ?

There was another report about RAND_poll in Vista, but trouble is that it's irreproducible in simple test applications.

Is there anyway I can bypass that RAND_poll() call (as described in the last paragraph of http://www.mail-archive.com/openssl-dev@openssl.org/msg18900.html).

Can you test if below code makes your application work by appending it to crypto/rand/md_rand.c? Idea here is to call RAND_poll from code which is [believed to be] serialized by Windows. A.

#if defined(_WIN32)
#if defined(__GNUC__) && __GNUC__>=2
static int premain(void) __attribute__((constructor));
#endif
static int premain(void)
        {
        if (!initialized)
                {
                RAND_poll();
                initialized = 1;
                }
        return 0;
        }
#if defined(_MSC_VER)
# if defined(_WIN64)
#  pragma section(".CRT$XCU",read)
   __declspec(allocate(".CRT$XCU"))
# else
#  pragma data_seg(".CRT$XCU")
# endif
   static int (*p)(void) = premain;
#  pragma data_seg()
#endif
#endif

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

Reply via email to