Skip to contentSkip to conversation

Backported pkcs11-related parts of 7a8d707237bb18 to 2.2 branch

PATCH Applied [email protected]... 2 participants 3 messages Dec 14, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Backported pkcs11-related parts of 7a8d707237bb18 to 2.2 branch

From: Samuli Seppänen <[email protected]...>

Fixes https://community.openvpn.net/openvpn/ticket/145

---
 win/config.h.in |    4 +++-
 win/msvc.mak.in |   11 ++++++++---
 win/settings.in |    4 ++++
 3 files changed, 15 insertions(+), 4 deletions(-)
win/config.h.in +3 -1
index 82344a0..09263d3 100644
@@ -74,7 +74,9 @@ typedef unsigned long in_addr_t;
 #endif
 
 /* Enable PKCS#11 support */
-/* #define USE_PKCS11 1 */
+#if @USE_PKCS11@ != 0
+#define USE_PKCS11 1
+#endif
 
 /* Enable HTTP proxy support */
 #if @ENABLE_HTTP_PROXY@ != 0
win/msvc.mak.in +8 -3
index ac17ae9..7979b5e 100644
@@ -14,14 +14,19 @@
 OPENSSL = @OPENSSL_DIR@
 OPENSSL_DYNAMIC = libeay32.lib ssleay32.lib
 
+PKCS11_HELPER = @PKCS11_HELPER_DIR@
+!ifdef INCLUDE_PKCS11
+PKCS11_HELPER_DYNAMIC = pkcs11-helper.lib
+!endif
+
 LZO = @LZO_DIR@
 LZO_DYNAMIC = lzo2.lib
 
-INCLUDE_DIRS = -I$(OPENSSL)/include -I$(LZO)/include
+INCLUDE_DIRS = -I$(OPENSSL)/include -I$(LZO)/include -I$(PKCS11_HELPER)/include
 
-LIBS = $(OPENSSL_DYNAMIC) $(LZO_DYNAMIC) ws2_32.lib crypt32.lib iphlpapi.lib winmm.lib user32.lib gdi32.lib advapi32.lib wininet.lib
+LIBS = $(OPENSSL_DYNAMIC) $(PKCS11_HELPER_DYNAMIC) $(LZO_DYNAMIC) ws2_32.lib crypt32.lib iphlpapi.lib winmm.lib user32.lib gdi32.lib advapi32.lib wininet.lib
 
-LIB_DIRS = -LIBPATH:$(OPENSSL)\lib -LIBPATH:$(LZO)\lib
+LIB_DIRS = -LIBPATH:$(OPENSSL)\lib -LIBPATH:$(PKCS11_HELPER)\lib -LIBPATH:$(LZO)\lib
 
 EXE = openvpn.exe
 
win/settings.in +4 -0
index 10c7926..a197fb8 100644
@@ -33,6 +33,10 @@
 !define OPENVPN_GUI_DIR "../openvpn-gui"
 !define OPENVPN_GUI     "openvpn-gui-1.0.3.exe"
 
+# Uncomment to use the PKCS#11 helper library
+!define USE_PKCS11 0
+;!define INCLUDE_PKCS11
+
 # Prebuilt libraries.  DMALLOC is optional.
 !define OPENSSL_DIR	  "../openssl"
 !define LZO_DIR		  "../lzo"
Signature · 1 line
1.7.4.1
#1 lore raw

Just for clarification... this patch adds pkcs11 build option support to Python/Visual Studio build system and thus allows fixing this bug:

<https://community.openvpn.net/openvpn/ticket/145>

Quoted 66 lines

From: Samuli Seppänen <[email protected]...>

Fixes https://community.openvpn.net/openvpn/ticket/145

---
 win/config.h.in |    4 +++-
 win/msvc.mak.in |   11 ++++++++---
 win/settings.in |    4 ++++
 3 files changed, 15 insertions(+), 4 deletions(-)
win/config.h.in +3 -1
index 82344a0..09263d3 100644
@@ -74,7 +74,9 @@ typedef unsigned long in_addr_t;
 #endif
 
 /* Enable PKCS#11 support */
-/* #define USE_PKCS11 1 */
+#if @USE_PKCS11@ != 0
+#define USE_PKCS11 1
+#endif
 
 /* Enable HTTP proxy support */
 #if @ENABLE_HTTP_PROXY@ != 0
win/msvc.mak.in +8 -3
index ac17ae9..7979b5e 100644
@@ -14,14 +14,19 @@
 OPENSSL = @OPENSSL_DIR@
 OPENSSL_DYNAMIC = libeay32.lib ssleay32.lib
 
+PKCS11_HELPER = @PKCS11_HELPER_DIR@
+!ifdef INCLUDE_PKCS11
+PKCS11_HELPER_DYNAMIC = pkcs11-helper.lib
+!endif
+
 LZO = @LZO_DIR@
 LZO_DYNAMIC = lzo2.lib
 
-INCLUDE_DIRS = -I$(OPENSSL)/include -I$(LZO)/include
+INCLUDE_DIRS = -I$(OPENSSL)/include -I$(LZO)/include -I$(PKCS11_HELPER)/include
 
-LIBS = $(OPENSSL_DYNAMIC) $(LZO_DYNAMIC) ws2_32.lib crypt32.lib iphlpapi.lib winmm.lib user32.lib gdi32.lib advapi32.lib wininet.lib
+LIBS = $(OPENSSL_DYNAMIC) $(PKCS11_HELPER_DYNAMIC) $(LZO_DYNAMIC) ws2_32.lib crypt32.lib iphlpapi.lib winmm.lib user32.lib gdi32.lib advapi32.lib wininet.lib
 
-LIB_DIRS = -LIBPATH:$(OPENSSL)\lib -LIBPATH:$(LZO)\lib
+LIB_DIRS = -LIBPATH:$(OPENSSL)\lib -LIBPATH:$(PKCS11_HELPER)\lib -LIBPATH:$(LZO)\lib
 
 EXE = openvpn.exe
 
win/settings.in +4 -0
index 10c7926..a197fb8 100644
@@ -33,6 +33,10 @@
 !define OPENVPN_GUI_DIR "../openvpn-gui"
 !define OPENVPN_GUI     "openvpn-gui-1.0.3.exe"
 
+# Uncomment to use the PKCS#11 helper library
+!define USE_PKCS11 0
+;!define INCLUDE_PKCS11
+
 # Prebuilt libraries.  DMALLOC is optional.
 !define OPENSSL_DIR	  "../openssl"
 !define LZO_DIR		  "../lzo"
#2 lore raw
In reply to [email protected]...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 7 lines · On 14/12/11 09:36, [email protected]... wrote:

From: Samuli Seppänen <[email protected]...>

Fixes https://community.openvpn.net/openvpn/ticket/145 ---

win/config.h.in |    4 +++- win/msvc.mak.in |   11 ++++++++--- 
win/settings.in |    4 ++++ 3 files changed, 15 insertions(+), 4

deletions(-)

Applied to the release/2.2 branch on stable.

commit 81ce1d45f88bec701fd477fa061acd0f0033fdf9

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7ogx8ACgkQDC186MBRfroIfwCdGQ1w7X/4XYY4ERAOMCEK8rXX WGEAoI2hOhtdNzGLh5xSQmJZ/648sBjN
=Ese4
-----END PGP SIGNATURE-----