From: james Date: Sat, 15 Oct 2005 12:14:56 +0000 (+0000) Subject: Fixed some minor build issues with PKCS11 patch: X-Git-Tag: v2.1_rc1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be38c0514aabcff8b4a0b588a06d36c150c8b5ed;p=thirdparty%2Fopenvpn.git Fixed some minor build issues with PKCS11 patch: "make dist" wasn't building correct tarball. Some ./configure --enable/--disable options were broken. Renamed pkcs11 directory to pkcs11-headers to work around automake issue. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@626 e7ae566f-a301-0410-adde-c780ea21d3b5 --- diff --git a/Makefile.am b/Makefile.am index 030894777..abf1fcd8f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,7 +65,7 @@ openvpn_SOURCES = \ multi.c multi.h \ ntlm.c ntlm.h \ occ.c occ.h occ-inline.h \ - pkcs11.c pkcs11.h \ + pkcs11.c pkcs11.h cryptoki.h \ openvpn.c openvpn.h \ openvpn-plugin.h \ options.c options.h \ @@ -123,7 +123,9 @@ EXTRA_DIST = \ contrib \ debug \ plugins \ - management + management \ + pkcs11-headers \ + cryptoki-win32.h dist-hook: cd $(distdir) && for i in $(EXTRA_DIST) ; do find $$i -name .svn -type d -prune -exec rm -rf '{}' ';' ; rm -f `find $$i -type f | grep -E '(^|\/)\.?\#|\~$$|\.s?o$$'` ; done diff --git a/config-win32.h.in b/config-win32.h.in index 054ecccc7..ab036f1b9 100644 --- a/config-win32.h.in +++ b/config-win32.h.in @@ -75,7 +75,7 @@ typedef unsigned long in_addr_t; #define ENABLE_MANAGEMENT 1 /* Enable PKCS#11 support */ -#define ENABLE_PKCS11 1 +#define USE_PKCS11 1 /* Enable HTTP proxy support */ #define ENABLE_HTTP_PROXY 1 diff --git a/configure.ac b/configure.ac index 844778f89..6b01f3763 100644 --- a/configure.ac +++ b/configure.ac @@ -466,7 +466,7 @@ fi dnl dnl Check for dlopen -- first try libc then libdl. dnl -if test "$PLUGINS" = "yes"; then +if test "$PLUGINS" = "yes" || test "$PKCS11" = "yes"; then AC_CHECKING([for libdl Library and Header files]) AC_CHECK_HEADER(dlfcn.h, [AC_CHECK_FUNC(dlopen, @@ -603,7 +603,7 @@ fi dnl enable pkcs11 capability if test "$PKCS11" = "yes"; then - AC_DEFINE(ENABLE_PKCS11, 1, [Enable PKCS#11 capability]) + AC_DEFINE(USE_PKCS11, 1, [Enable PKCS11 capability]) fi dnl enable socks diff --git a/cryptoki-win32.h b/cryptoki-win32.h index 8f0291bc4..8e62bbdcc 100644 --- a/cryptoki-win32.h +++ b/cryptoki-win32.h @@ -59,7 +59,7 @@ #define NULL_PTR 0 #endif -#include "pkcs11/pkcs11.h" +#include "pkcs11-headers/pkcs11.h" #pragma pack(pop, cryptoki) diff --git a/cryptoki.h b/cryptoki.h index b0ab3e818..2975a6783 100644 --- a/cryptoki.h +++ b/cryptoki.h @@ -30,6 +30,6 @@ #define NULL_PTR 0 #endif -#include "pkcs11/pkcs11.h" +#include "pkcs11-headers/pkcs11.h" #endif /* ___CRYPTOKI_H_INC___ */ diff --git a/install-win32/prebuild b/install-win32/prebuild index 8f6ac3bf6..be7ef9f52 100755 --- a/install-win32/prebuild +++ b/install-win32/prebuild @@ -54,11 +54,11 @@ gcc -O2 $SCRIPTS/u2d.c -o $U2D echo BUILD output dir from source rm -rf $OUT mkdir $OUT -mkdir $OUT/pkcs11 +mkdir $OUT/pkcs11-headers cp $IN/*.[ch] $OUT rm -f $OUT/config.h -cp $IN/pkcs11/*.h $OUT/pkcs11 +cp $IN/pkcs11-headers/*.h $OUT/pkcs11-headers if [ $MISC ]; then cp $MISC/*.* $OUT diff --git a/pkcs11/pkcs11.h b/pkcs11-headers/pkcs11.h similarity index 100% rename from pkcs11/pkcs11.h rename to pkcs11-headers/pkcs11.h diff --git a/pkcs11/pkcs11f.h b/pkcs11-headers/pkcs11f.h similarity index 100% rename from pkcs11/pkcs11f.h rename to pkcs11-headers/pkcs11f.h diff --git a/pkcs11/pkcs11t.h b/pkcs11-headers/pkcs11t.h similarity index 100% rename from pkcs11/pkcs11t.h rename to pkcs11-headers/pkcs11t.h diff --git a/pkcs11.c b/pkcs11.c index 7352e8f1d..cee178ee6 100644 --- a/pkcs11.c +++ b/pkcs11.c @@ -34,9 +34,10 @@ #include "config.h" #endif -#if defined(USE_CRYPTO) && defined(USE_SSL) && defined(ENABLE_PKCS11) - #include "syshead.h" + +#if defined(ENABLE_PKCS11) + #include "error.h" #include "misc.h" #include "ssl.h" diff --git a/pkcs11.h b/pkcs11.h index 7f44e1ba4..fdb1b9139 100644 --- a/pkcs11.h +++ b/pkcs11.h @@ -25,7 +25,9 @@ #ifndef OPENVPN_PKCS11_H #define OPENVPN_PKCS11_H -#if defined(USE_CRYPTO) && defined(USE_SSL) && defined(ENABLE_PKCS11) +#if defined(ENABLE_PKCS11) + +#include int SSL_CTX_use_pkcs11 ( diff --git a/syshead.h b/syshead.h index a786e65ab..c5ef47b41 100644 --- a/syshead.h +++ b/syshead.h @@ -435,6 +435,13 @@ socket_defined (const socket_descriptor_t sd) #define NTLM 0 #endif +/* + * Do we have PKCS11 capability? + */ +#if defined(USE_PKCS11) && defined(USE_CRYPTO) && defined(USE_SSL) +#define ENABLE_PKCS11 +#endif + /* * Is poll available on this platform? */