From: Simon Josefsson Date: Tue, 19 Aug 2008 15:02:58 +0000 (+0200) Subject: Windows initialization fixes, tiny change from Adam Strzelecki . X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c1548f0f31e41ec9e36e349094a59ea3702e08c;p=pspp Windows initialization fixes, tiny change from Adam Strzelecki . lib/gc-gnulib.c: Use CRYPT_VERIFY_CONTEXT. Try to use Intel CSP if present, for intel RND. Return error on failures. --- diff --git a/ChangeLog b/ChangeLog index 5e303c75ad..0b064bbb65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-19 Adam Strzelecki (tiny change) + + * lib/gc-gnulib.c: Use CRYPT_VERIFY_CONTEXT. Try to use Intel CSP + if present, for intel RND. Return error on failures. + 2008-08-18 Ben Pfaff gitlog-to-changelog: give better diagnostic for failed pipe-open diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index fabc663bca..98214ed15e 100644 --- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -78,6 +78,12 @@ # include # include HCRYPTPROV g_hProv = 0; +# ifndef PROV_INTEL_SEC +# define PROV_INTEL_SEC 22 +# endif +# ifndef CRYPT_VERIFY_CONTEXT +# define CRYPT_VERIFY_CONTEXT 0xF0000000 +# endif # endif #endif @@ -88,7 +94,9 @@ gc_init (void) # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ if(g_hProv) CryptReleaseContext(g_hProv, 0); - CryptAcquireContext(&g_hProv, NULL, NULL, PROV_RSA_FULL, 0); + if(!CryptAcquireContext(&g_hProv, NULL, NULL, PROV_INTEL_SEC, CRYPT_VERIFY_CONTEXT)) + if(!CryptAcquireContext(&g_hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFY_CONTEXT)) + return GC_RANDOM_ERROR; # endif #endif