mirror of
https://github.com/OpenVPN/openvpn.git
synced 2025-05-09 21:51:05 +08:00
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
This commit is contained in:
parent
b16cd4d28c
commit
a7eef14a3e
14
cryptoapi.c
14
cryptoapi.c
@ -51,7 +51,7 @@
|
|||||||
#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
|
#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
|
||||||
#define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
|
#define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
|
||||||
static HINSTANCE crypt32dll = NULL;
|
static HINSTANCE crypt32dll = NULL;
|
||||||
static BOOL WINAPI (*CryptAcquireCertificatePrivateKey) (PCCERT_CONTEXT pCert, DWORD dwFlags,
|
static BOOL WINAPI (*OpenVPNCryptAcquireCertificatePrivateKey) (PCCERT_CONTEXT pCert, DWORD dwFlags,
|
||||||
void *pvReserved, HCRYPTPROV *phCryptProv, DWORD *pdwKeySpec, BOOL *pfCallerFreeProv) = NULL;
|
void *pvReserved, HCRYPTPROV *phCryptProv, DWORD *pdwKeySpec, BOOL *pfCallerFreeProv) = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ static ERR_STRING_DATA CRYPTOAPI_str_functs[] = {
|
|||||||
{ ERR_PACK(ERR_LIB_CRYPTOAPI, 0, 0), "microsoft cryptoapi"},
|
{ ERR_PACK(ERR_LIB_CRYPTOAPI, 0, 0), "microsoft cryptoapi"},
|
||||||
{ ERR_PACK(0, CRYPTOAPI_F_CERT_OPEN_SYSTEM_STORE, 0), "CertOpenSystemStore" },
|
{ ERR_PACK(0, CRYPTOAPI_F_CERT_OPEN_SYSTEM_STORE, 0), "CertOpenSystemStore" },
|
||||||
{ ERR_PACK(0, CRYPTOAPI_F_CERT_FIND_CERTIFICATE_IN_STORE, 0), "CertFindCertificateInStore" },
|
{ ERR_PACK(0, CRYPTOAPI_F_CERT_FIND_CERTIFICATE_IN_STORE, 0), "CertFindCertificateInStore" },
|
||||||
{ ERR_PACK(0, CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY, 0), "CryptAcquireCertificatePrivateKey" },
|
{ ERR_PACK(0, CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY, 0), "OpenVPNCryptAcquireCertificatePrivateKey" },
|
||||||
{ ERR_PACK(0, CRYPTOAPI_F_CRYPT_CREATE_HASH, 0), "CryptCreateHash" },
|
{ ERR_PACK(0, CRYPTOAPI_F_CRYPT_CREATE_HASH, 0), "CryptCreateHash" },
|
||||||
{ ERR_PACK(0, CRYPTOAPI_F_CRYPT_GET_HASH_PARAM, 0), "CryptGetHashParam" },
|
{ ERR_PACK(0, CRYPTOAPI_F_CRYPT_GET_HASH_PARAM, 0), "CryptGetHashParam" },
|
||||||
{ ERR_PACK(0, CRYPTOAPI_F_CRYPT_SET_HASH_PARAM, 0), "CryptSetHashParam" },
|
{ 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)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CryptAcquireCertificatePrivateKey == NULL) {
|
if (OpenVPNCryptAcquireCertificatePrivateKey == NULL) {
|
||||||
CryptAcquireCertificatePrivateKey = GetProcAddress(crypt32dll,
|
OpenVPNCryptAcquireCertificatePrivateKey = GetProcAddress(crypt32dll,
|
||||||
"CryptAcquireCertificatePrivateKey");
|
"OpenVPNCryptAcquireCertificatePrivateKey");
|
||||||
if (CryptAcquireCertificatePrivateKey == NULL) {
|
if (OpenVPNCryptAcquireCertificatePrivateKey == NULL) {
|
||||||
CRYPTOAPIerr(CRYPTOAPI_F_GET_PROC_ADDRESS);
|
CRYPTOAPIerr(CRYPTOAPI_F_GET_PROC_ADDRESS);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!CryptAcquireCertificatePrivateKey(cd->cert_context, CRYPT_ACQUIRE_COMPARE_KEY_FLAG,
|
if (!OpenVPNCryptAcquireCertificatePrivateKey(cd->cert_context, CRYPT_ACQUIRE_COMPARE_KEY_FLAG,
|
||||||
NULL, &cd->crypt_prov, &cd->key_spec, &cd->free_crypt_prov)) {
|
NULL, &cd->crypt_prov, &cd->key_spec, &cd->free_crypt_prov)) {
|
||||||
/* if we don't have a smart card reader here, and we try to access a
|
/* if we don't have a smart card reader here, and we try to access a
|
||||||
* smart card certificate, we get:
|
* smart card certificate, we get:
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
# These settings will then drive the rest of the build process.
|
# These settings will then drive the rest of the build process.
|
||||||
install-win32/winconfig
|
install-win32/winconfig
|
||||||
|
|
||||||
# Delete the GENOUT directory if CLEAN="yes"
|
# clean all generated files
|
||||||
install-win32/doclean
|
install-win32/doclean
|
||||||
|
|
||||||
# Load a pre-built GENOUT directory if GENOUT_PREBUILT is defined
|
# Load a pre-built GENOUT directory if GENOUT_PREBUILT is defined
|
||||||
|
@ -2,20 +2,20 @@ Rebuild OpenSSL tarball without symbolic links, so
|
|||||||
it can be extracted on Windows (run on Unix):
|
it can be extracted on Windows (run on Unix):
|
||||||
|
|
||||||
[download tarball and .asc sig]
|
[download tarball and .asc sig]
|
||||||
gpg --verify openssl-0.9.8i.tar.gz.asc
|
gpg --verify openssl-0.9.8k.tar.gz.asc
|
||||||
tar xfz openssl-0.9.8i.tar.gz
|
tar xfz openssl-0.9.8k.tar.gz
|
||||||
tar cfzh openssl-0.9.8i-nolinks.tar.gz openssl-0.9.8i
|
tar cfzh openssl-0.9.8k-nolinks.tar.gz openssl-0.9.8k
|
||||||
|
|
||||||
To apply patch (in MSYS shell):
|
To apply patch (in MSYS shell):
|
||||||
|
|
||||||
cd /c/src/openssl-0.9.8i
|
cd /c/src/openssl-0.9.8k
|
||||||
patch -p1 <../21/install-win32/openssl/openssl098.patch
|
patch -p1 <../21/install-win32/openssl/openssl098.patch
|
||||||
|
|
||||||
To build OpenSSL, open a command prompt window, then:
|
To build OpenSSL, open a command prompt window, then:
|
||||||
|
|
||||||
cd \src\openssl-0.9.8i
|
cd \src\openssl-0.9.8k
|
||||||
ms\mw
|
ms\mw
|
||||||
|
|
||||||
To build a new patch (optional):
|
To build a new patch (optional):
|
||||||
|
|
||||||
diff -urw openssl-0.9.8i.orig openssl-0.9.8i | grep -v '^Only in' >openssl098.patch
|
diff -urw openssl-0.9.8k.orig openssl-0.9.8k | grep -v '^Only in' >openssl098.patch
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
;!define OPENVPN_XGUI_DIR "../ovpnxml"
|
;!define OPENVPN_XGUI_DIR "../ovpnxml"
|
||||||
|
|
||||||
# Prebuilt libraries. DMALLOC is optional.
|
# Prebuilt libraries. DMALLOC is optional.
|
||||||
!define OPENSSL_DIR "../openssl-0.9.8i"
|
!define OPENSSL_DIR "../openssl-0.9.8k"
|
||||||
!define LZO_DIR "../lzo-2.02"
|
!define LZO_DIR "../lzo-2.02"
|
||||||
!define PKCS11_HELPER_DIR "../pkcs11-helper"
|
!define PKCS11_HELPER_DIR "../pkcs11-helper"
|
||||||
;!define DMALLOC_DIR "../dmalloc-5.4.2"
|
;!define DMALLOC_DIR "../dmalloc-5.4.2"
|
||||||
@ -35,15 +35,15 @@
|
|||||||
# tapinstall.exe source code.
|
# tapinstall.exe source code.
|
||||||
# Not needed if DRVBINSRC is defined
|
# Not needed if DRVBINSRC is defined
|
||||||
# (or if using pre-built mode).
|
# (or if using pre-built mode).
|
||||||
!define TISRC "../tapinstall"
|
;!define TISRC "../tapinstall"
|
||||||
|
|
||||||
# TAP Adapter parameters. Note that PRODUCT_TAP_ID is
|
# TAP Adapter parameters. Note that PRODUCT_TAP_ID is
|
||||||
# defined in version.m4.
|
# defined in version.m4.
|
||||||
!define PRODUCT_TAP_DEVICE_DESCRIPTION "TAP-Win32 Adapter V9"
|
!define PRODUCT_TAP_DEVICE_DESCRIPTION "TAP-Win32 Adapter V9"
|
||||||
!define PRODUCT_TAP_PROVIDER "TAP-Win32 Provider V9"
|
!define PRODUCT_TAP_PROVIDER "TAP-Win32 Provider V9"
|
||||||
!define PRODUCT_TAP_MAJOR_VER 9
|
!define PRODUCT_TAP_MAJOR_VER 9
|
||||||
!define PRODUCT_TAP_MINOR_VER 4
|
!define PRODUCT_TAP_MINOR_VER 5
|
||||||
!define PRODUCT_TAP_RELDATE "01/22/2008"
|
!define PRODUCT_TAP_RELDATE "05/13/2009"
|
||||||
|
|
||||||
# TAP adapter icon -- visible=0x81 or hidden=0x89
|
# TAP adapter icon -- visible=0x81 or hidden=0x89
|
||||||
!define PRODUCT_TAP_CHARACTERISTICS 0x81
|
!define PRODUCT_TAP_CHARACTERISTICS 0x81
|
||||||
@ -53,8 +53,8 @@
|
|||||||
|
|
||||||
# DDK Version.
|
# DDK Version.
|
||||||
# DDK distribution is assumed to be in C:\WINDDK\${DDKVER}
|
# DDK distribution is assumed to be in C:\WINDDK\${DDKVER}
|
||||||
!define DDKVER 6001.17121
|
;!define DDKVER 6001.18002
|
||||||
!define DDKVER_MAJOR 6001
|
;!define DDKVER_MAJOR 6001
|
||||||
|
|
||||||
# Code Signing.
|
# Code Signing.
|
||||||
# If undefined, don't sign any files.
|
# If undefined, don't sign any files.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user