diff options
Diffstat (limited to 'openvpn')
-rw-r--r-- | openvpn/Android.mk | 14 | ||||
-rw-r--r-- | openvpn/config.h | 5 | ||||
-rw-r--r-- | openvpn/src/compat/compat-rsa_generate_key.c | 2 |
3 files changed, 18 insertions, 3 deletions
diff --git a/openvpn/Android.mk b/openvpn/Android.mk index 23e24448..5659b607 100644 --- a/openvpn/Android.mk +++ b/openvpn/Android.mk @@ -3,14 +3,22 @@ LOCAL_PATH:= $(call my-dir)/ include $(CLEAR_VARS) LOCAL_LDLIBS := -lz -LOCAL_C_INCLUDES := openssl/include lzo/include openssl/crypto openssl openvpn/src/compat openvpn/src/openvpn openvpn/include google-breakpad/src google-breakpad/src/common/android/include +LOCAL_C_INCLUDES := openssl/include lzo/include openssl/crypto openssl openvpn/src/compat openvpn/src/openvpn openvpn/include google-breakpad/src google-breakpad/src/common/android/include polarssl/include + -LOCAL_SHARED_LIBRARIES := libssl libcrypto #LOCAL_STATIC_LIBRARIES := libssl_static libcrypto_static liblzo-static LOCAL_CFLAGS= -DHAVE_CONFIG_H -DTARGET_ABI=\"${TARGET_ABI}\" LOCAL_STATIC_LIBRARIES := liblzo-static +ifeq ($(USE_POLAR),1) +LOCAL_STATIC_LIBRARIES += polarssl-static +LOCAL_CFLAGS += -DENABLE_CRYPTO_POLARSSL=1 +else +LOCAL_SHARED_LIBRARIES := libssl libcrypto +LOCAL_CFLAGS += -DENABLE_CRYPTO_OPENSSL=1 +endif + ifeq ($(WITH_BREAKPAD),1) LOCAL_STATIC_LIBRARIES += breakpad_client LOCAL_CFLAGS += -DGOOGLE_BREAKPAD=1 @@ -32,6 +40,7 @@ LOCAL_SRC_FILES:= \ src/openvpn/console.c \ src/openvpn/crypto.c \ src/openvpn/crypto_openssl.c \ + src/openvpn/crypto_polarssl.c \ src/openvpn/cryptoapi.c \ src/openvpn/dhcp.c \ src/openvpn/error.c \ @@ -85,6 +94,7 @@ LOCAL_SRC_FILES:= \ src/openvpn/socks.c \ src/openvpn/ssl.c \ src/openvpn/ssl_openssl.c \ + src/openvpn/ssl_polarssl.c \ src/openvpn/ssl_verify.c \ src/openvpn/ssl_verify_openssl.c \ src/openvpn/ssl_verify_polarssl.c \ diff --git a/openvpn/config.h b/openvpn/config.h index 4dfd7bc5..8e738f37 100644 --- a/openvpn/config.h +++ b/openvpn/config.h @@ -550,7 +550,10 @@ #define ENABLE_SSL 1 #define USE_SSL 1 #define ENABLE_CRYPTO 1 -#define ENABLE_CRYPTO_OPENSSL 1 + +/* via android.mk */ +/*#define ENABLE_CRYPTO_OPENSSL 1*/ +/* #define ENABLE_CRYPTO_POLARSSL 1 */ /* Use valgrind memory debugging library */ /* #undef USE_VALGRIND */ diff --git a/openvpn/src/compat/compat-rsa_generate_key.c b/openvpn/src/compat/compat-rsa_generate_key.c index 99725da1..87dd1ccb 100644 --- a/openvpn/src/compat/compat-rsa_generate_key.c +++ b/openvpn/src/compat/compat-rsa_generate_key.c @@ -4,6 +4,7 @@ #include <openssl/bn.h> #include <openssl/rsa.h> +#ifdef ENABLE_CRYPTO_OPENSSL RSA *RSA_generate_key(int bits, unsigned long e_value, void (*callback)(int,int,void *), void *cb_arg) { @@ -45,3 +46,4 @@ getpass (prompt) return ""; } +#endif |