Browse code

Fixed issue of symbol conflicts interfering with Windows CryptoAPI functionality (Alon Bar-Lev).

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@4475 e7ae566f-a301-0410-adde-c780ea21d3b5

james authored on 2009/05/31 04:53:49
Showing 4 changed files
... ...
@@ -318,7 +318,6 @@ typedef unsigned long in_addr_t;
318 318
 #define S_IRUSR 0
319 319
 #define S_IWUSR 0
320 320
 typedef int intptr_t;
321
-#undef S_NORMAL
322 321
 /* Visual Studio 2005 supports vararg macros */
323 322
 #if _MSC_VER >= 1400
324 323
 #define HAVE_CPP_VARARG_MACRO_ISO 1
... ...
@@ -75,7 +75,7 @@ static ERR_STRING_DATA CRYPTOAPI_str_functs[] =	{
75 75
     { ERR_PACK(ERR_LIB_CRYPTOAPI, 0, 0),				    "microsoft cryptoapi"},
76 76
     { ERR_PACK(0, CRYPTOAPI_F_CERT_OPEN_SYSTEM_STORE, 0),		    "CertOpenSystemStore" },
77 77
     { ERR_PACK(0, CRYPTOAPI_F_CERT_FIND_CERTIFICATE_IN_STORE, 0),	    "CertFindCertificateInStore" },
78
-    { ERR_PACK(0, CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY, 0),    "OpenVPNCryptAcquireCertificatePrivateKey" },
78
+    { ERR_PACK(0, CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY, 0),    "CryptAcquireCertificatePrivateKey" },
79 79
     { ERR_PACK(0, CRYPTOAPI_F_CRYPT_CREATE_HASH, 0),			    "CryptCreateHash" },
80 80
     { ERR_PACK(0, CRYPTOAPI_F_CRYPT_GET_HASH_PARAM, 0),			    "CryptGetHashParam" },
81 81
     { ERR_PACK(0, CRYPTOAPI_F_CRYPT_SET_HASH_PARAM, 0),			    "CryptSetHashParam" },
... ...
@@ -389,7 +389,7 @@ int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop)
389 389
     }
390 390
     if (OpenVPNCryptAcquireCertificatePrivateKey == NULL) {
391 391
 	OpenVPNCryptAcquireCertificatePrivateKey = GetProcAddress(crypt32dll,
392
-		"OpenVPNCryptAcquireCertificatePrivateKey");
392
+		"CryptAcquireCertificatePrivateKey");
393 393
 	if (OpenVPNCryptAcquireCertificatePrivateKey == NULL) {
394 394
 	    CRYPTOAPIerr(CRYPTOAPI_F_GET_PROC_ADDRESS);
395 395
 	    goto err;
... ...
@@ -1716,8 +1716,8 @@ state_name (int state)
1716 1716
       return "S_GOT_KEY";
1717 1717
     case S_ACTIVE:
1718 1718
       return "S_ACTIVE";
1719
-    case S_NORMAL:
1720
-      return "S_NORMAL";
1719
+    case S_NORMAL_OP:
1720
+      return "S_NORMAL_OP";
1721 1721
     case S_ERROR:
1722 1722
       return "S_ERROR";
1723 1723
     default:
... ...
@@ -3642,8 +3642,8 @@ tls_process (struct tls_multi *multi,
3642 3642
 		}
3643 3643
 	      else /* assume that ks->state == S_ACTIVE */
3644 3644
 		{
3645
-		  dmsg (D_TLS_DEBUG_MED, "STATE S_NORMAL");
3646
-		  ks->state = S_NORMAL;
3645
+		  dmsg (D_TLS_DEBUG_MED, "STATE S_NORMAL_OP");
3646
+		  ks->state = S_NORMAL_OP;
3647 3647
 		  ks->must_negotiate = 0;
3648 3648
 		}
3649 3649
 	    }
... ...
@@ -230,7 +230,7 @@
230 230
 #define S_SENT_KEY        4	/* client does S_SENT_KEY -> S_GOT_KEY */
231 231
 #define S_GOT_KEY         5	/* server does S_GOT_KEY -> S_SENT_KEY */
232 232
 #define S_ACTIVE          6	/* ready to exchange data channel packets */
233
-#define S_NORMAL          7	/* normal operations */
233
+#define S_NORMAL_OP       7	/* normal operations */
234 234
 
235 235
 /*
236 236
  * Are we ready to receive data channel packets?