Hi,

At 02 Aug 2005 14:23:17 +0200 Andy Polyakov wrote:
> In rand_win.c we could read
> 
> #if defined(OPENSSL_SYS_WINCE) && WCEPLATFORM!=MS_HPC_PRO
> 
> Well, WCEPLATFORM!=MS_HPC_PRO condition is *never* met... Meaning that
> CryptGenRandom was never called on *any* WCE platform, instead of all
> but MS_HPC_PRO... Fixed by replacing it with _WIN32_WCE>=210 condition,
> which is minimum requirement according to MSDN.

I agree with this change.

Here is a patch which eliminates some 'unreferenced local variable'
warnings. In addition to that, change not to call GetVersion because it
is not supported.


diff -ur openssl-0.9.8-stable-SNAP-20050802.orig/crypto/rand/rand_win.c 
openssl-0.9.8-stable-SNAP-20050802/crypto/rand/rand_win.c
--- openssl-0.9.8-stable-SNAP-20050802.orig/crypto/rand/rand_win.c      
2005-05-21 23:00:22.000000000 +0900
+++ openssl-0.9.8-stable-SNAP-20050802/crypto/rand/rand_win.c   2005-08-02 
23:51:45.833052600 +0900
@@ -195,10 +195,14 @@
        HCRYPTPROV hProvider = 0;
        BYTE buf[64];
        DWORD w;
+#ifndef OPENSSL_SYS_WINCE
        HWND h;
+#endif
        int good = 0;
 
+#ifndef OPENSSL_SYS_WINCE
        HMODULE advapi, kernel, user, netapi;
+#endif
        CRYPTACQUIRECONTEXTW acquire = 0;
        CRYPTGENRANDOM gen = 0;
        CRYPTRELEASECONTEXT release = 0;
@@ -217,7 +221,7 @@
         osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO) ;
         GetVersionEx( &osverinfo ) ;
 
-#if defined(OPENSSL_SYS_WINCE) && WCEPLATFORM!=MS_HPC_PRO
+#if defined(OPENSSL_SYS_WINCE) && _WIN32_WCE >= 210
 #ifndef CryptAcquireContext
 #define CryptAcquireContext CryptAcquireContextW
 #endif
@@ -632,8 +636,10 @@
 void RAND_screen(void) /* function available for backward compatibility */
 {
        RAND_poll();
+#if !defined(OPENSSL_SYS_WINCE)
        if (GetVersion() >= 0x80000000 || !OPENSSL_isservice())
                readscreen();
+#endif
 }
 

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

Reply via email to