Browse code

Updated Windows build scripts to package openssl-0.9.8k, and to use the Server 2008 WDK (6001.18002).

In cryptoapi.c, renamed CryptAcquireCertificatePrivateKey to
OpenVPNCryptAcquireCertificatePrivateKey to work around
a symbol conflict in MinGW-5.1.4.exe.


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

james authored on 2009/05/13 22:36:23
Showing 4 changed files
... ...
@@ -51,8 +51,8 @@
51 51
 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
52 52
 #define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
53 53
 static HINSTANCE crypt32dll = NULL;
54
-static BOOL WINAPI (*CryptAcquireCertificatePrivateKey) (PCCERT_CONTEXT pCert, DWORD dwFlags,
55
-    void *pvReserved, HCRYPTPROV *phCryptProv, DWORD *pdwKeySpec, BOOL *pfCallerFreeProv) = NULL;
54
+static BOOL WINAPI (*OpenVPNCryptAcquireCertificatePrivateKey) (PCCERT_CONTEXT pCert, DWORD dwFlags,
55
+  void *pvReserved, HCRYPTPROV *phCryptProv, DWORD *pdwKeySpec, BOOL *pfCallerFreeProv) = NULL;
56 56
 #endif
57 57
 
58 58
 /* Size of an SSL signature: MD5+SHA1 */
... ...
@@ -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),    "CryptAcquireCertificatePrivateKey" },
78
+    { ERR_PACK(0, CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY, 0),    "OpenVPNCryptAcquireCertificatePrivateKey" },
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" },
... ...
@@ -387,16 +387,16 @@ int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop)
387 387
 	    goto err;
388 388
 	}
389 389
     }
390
-    if (CryptAcquireCertificatePrivateKey == NULL) {
391
-	CryptAcquireCertificatePrivateKey = GetProcAddress(crypt32dll,
392
-		"CryptAcquireCertificatePrivateKey");
393
-	if (CryptAcquireCertificatePrivateKey == NULL) {
390
+    if (OpenVPNCryptAcquireCertificatePrivateKey == NULL) {
391
+	OpenVPNCryptAcquireCertificatePrivateKey = GetProcAddress(crypt32dll,
392
+		"OpenVPNCryptAcquireCertificatePrivateKey");
393
+	if (OpenVPNCryptAcquireCertificatePrivateKey == NULL) {
394 394
 	    CRYPTOAPIerr(CRYPTOAPI_F_GET_PROC_ADDRESS);
395 395
 	    goto err;
396 396
 	}
397 397
     }
398 398
 #endif
399
-    if (!CryptAcquireCertificatePrivateKey(cd->cert_context, CRYPT_ACQUIRE_COMPARE_KEY_FLAG,
399
+    if (!OpenVPNCryptAcquireCertificatePrivateKey(cd->cert_context, CRYPT_ACQUIRE_COMPARE_KEY_FLAG,
400 400
 	    NULL, &cd->crypt_prov, &cd->key_spec, &cd->free_crypt_prov)) {
401 401
 	/* if we don't have a smart card reader here, and we try to access a
402 402
 	 * smart card certificate, we get:
... ...
@@ -96,7 +96,7 @@
96 96
 # These settings will then drive the rest of the build process. 
97 97
 install-win32/winconfig
98 98
 
99
-# Delete the GENOUT directory if CLEAN="yes"
99
+# clean all generated files
100 100
 install-win32/doclean
101 101
 
102 102
 # Load a pre-built GENOUT directory if GENOUT_PREBUILT is defined
... ...
@@ -2,20 +2,20 @@ Rebuild OpenSSL tarball without symbolic links, so
2 2
 it can be extracted on Windows (run on Unix):
3 3
 
4 4
   [download tarball and .asc sig]
5
-  gpg --verify openssl-0.9.8i.tar.gz.asc
6
-  tar xfz openssl-0.9.8i.tar.gz
7
-  tar cfzh openssl-0.9.8i-nolinks.tar.gz openssl-0.9.8i
5
+  gpg --verify openssl-0.9.8k.tar.gz.asc
6
+  tar xfz openssl-0.9.8k.tar.gz
7
+  tar cfzh openssl-0.9.8k-nolinks.tar.gz openssl-0.9.8k
8 8
 
9 9
 To apply patch (in MSYS shell):
10 10
 
11
-  cd /c/src/openssl-0.9.8i
11
+  cd /c/src/openssl-0.9.8k
12 12
   patch -p1 <../21/install-win32/openssl/openssl098.patch
13 13
 
14 14
 To build OpenSSL, open a command prompt window, then:
15 15
 
16
-  cd \src\openssl-0.9.8i
16
+  cd \src\openssl-0.9.8k
17 17
   ms\mw
18 18
 
19 19
 To build a new patch (optional):
20 20
 
21
-  diff -urw openssl-0.9.8i.orig openssl-0.9.8i | grep -v '^Only in' >openssl098.patch
21
+  diff -urw openssl-0.9.8k.orig openssl-0.9.8k | grep -v '^Only in' >openssl098.patch
... ...
@@ -22,7 +22,7 @@
22 22
 ;!define OPENVPN_XGUI_DIR "../ovpnxml"
23 23
 
24 24
 # Prebuilt libraries.  DMALLOC is optional.
25
-!define OPENSSL_DIR	  "../openssl-0.9.8i"
25
+!define OPENSSL_DIR	  "../openssl-0.9.8k"
26 26
 !define LZO_DIR		  "../lzo-2.02"
27 27
 !define PKCS11_HELPER_DIR "../pkcs11-helper"
28 28
 ;!define DMALLOC_DIR	  "../dmalloc-5.4.2"
... ...
@@ -35,15 +35,15 @@
35 35
 # tapinstall.exe source code.
36 36
 # Not needed if DRVBINSRC is defined
37 37
 # (or if using pre-built mode).
38
-!define TISRC	"../tapinstall"
38
+;!define TISRC	"../tapinstall"
39 39
 
40 40
 # TAP Adapter parameters.  Note that PRODUCT_TAP_ID is
41 41
 # defined in version.m4.
42 42
 !define PRODUCT_TAP_DEVICE_DESCRIPTION  "TAP-Win32 Adapter V9"
43 43
 !define PRODUCT_TAP_PROVIDER            "TAP-Win32 Provider V9"
44 44
 !define PRODUCT_TAP_MAJOR_VER           9
45
-!define PRODUCT_TAP_MINOR_VER           4
46
-!define PRODUCT_TAP_RELDATE             "01/22/2008"
45
+!define PRODUCT_TAP_MINOR_VER           5
46
+!define PRODUCT_TAP_RELDATE             "05/13/2009"
47 47
 
48 48
 # TAP adapter icon -- visible=0x81 or hidden=0x89
49 49
 !define PRODUCT_TAP_CHARACTERISTICS     0x81
... ...
@@ -53,8 +53,8 @@
53 53
 
54 54
 # DDK Version.
55 55
 # DDK distribution is assumed to be in C:\WINDDK\${DDKVER}
56
-!define DDKVER	     6001.17121
57
-!define DDKVER_MAJOR 6001
56
+;!define DDKVER	     6001.18002
57
+;!define DDKVER_MAJOR 6001
58 58
 
59 59
 # Code Signing.
60 60
 # If undefined, don't sign any files.