[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Apply windows patch from Dmitri Bely



Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv419/src/common

Modified Files:
	crypto.c 
Log Message:
Apply windows patch from Dmitri Bely

Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- crypto.c	3 Jan 2005 22:35:40 -0000	1.131
+++ crypto.c	12 Feb 2005 21:03:37 -0000	1.132
@@ -1399,15 +1399,15 @@
   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;
       }
     }