]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Apply windows patch from Dmitri Bely
authorNick Mathewson <nickm@torproject.org>
Sat, 12 Feb 2005 21:03:37 +0000 (21:03 +0000)
committerNick Mathewson <nickm@torproject.org>
Sat, 12 Feb 2005 21:03:37 +0000 (21:03 +0000)
svn:r3617

src/common/crypto.c

index fc69f7dd1e6dd12441fdcf1902a04f83bcd7d337..5ff6c8521bc6b022817e8f561a9e5933fcbd788f 100644 (file)
@@ -1399,15 +1399,15 @@ int crypto_seed_rng(void)
   char buf[DIGEST_LEN+1];
 
   if (!provider_set) {
-    if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, 0)) {
+    if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET)) {
       if (GetLastError() != NTE_BAD_KEYSET) {
         log_fn(LOG_ERR,"Can't get CryptoAPI provider [1]");
         return -1;
       }
       /* Yes, we need to try it twice. */
       if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
-                               CRYPT_NEWKEYSET)) {
-        log_fn(LOG_ERR,"Can't get CryptoAPI provider [2]");
+                               CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET)) {
+        log_fn(LOG_ERR,"Can't get CryptoAPI provider [2], error code: %x", GetLastError());
         return -1;
       }
     }