From 32fbbd9d1d7131d4891a889bd9a8f58aef395a31 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Fri, 22 Dec 2006 00:52:50 +0000 Subject: [PATCH] Backport workaround for unkown Windows configuration preventing security to work --- src/jrd/os/win32/guid.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jrd/os/win32/guid.cpp b/src/jrd/os/win32/guid.cpp index f7e06a206d..317e31d700 100644 --- a/src/jrd/os/win32/guid.cpp +++ b/src/jrd/os/win32/guid.cpp @@ -43,14 +43,15 @@ void GenerateRandomBytes(void* buffer, size_t size) HCRYPTPROV hProv; // Acquire crypto-provider context handle. - if (! CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0)) + if (! CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { if (GetLastError() == NTE_BAD_KEYSET) { // A common cause of this error is that the key container does not exist. // To create a key container, call CryptAcquireContext // using the CRYPT_NEWKEYSET flag. - if (! CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET)) + if (! CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET)) { Firebird::system_call_failed::raise("CryptAcquireContext"); }