Remove OpenSSL support
Only BoringSSL is supported currently. The OpenSSL code path is
untested.
Test: make -j32
Test: sha256sum libipsec.a and racoon before and after are same
Bug: 31464605
Change-Id: Id488fbd002eb7def672a9f7c42d3023cdcc454ec
diff --git a/Android.mk b/Android.mk
index 3754c4d..788b0f2 100644
--- a/Android.mk
+++ b/Android.mk
@@ -59,18 +59,9 @@
LOCAL_STATIC_LIBRARIES := libipsec
-LOCAL_SHARED_LIBRARIES := libcutils liblog libcrypto
+LOCAL_SHARED_LIBRARIES := libcutils liblog libcrypto libkeystore-engine
-ifneq (,$(wildcard $(TOP)/external/boringssl/flavor.mk))
- include $(TOP)/external/boringssl/flavor.mk
-else
- include $(TOP)/external/openssl/flavor.mk
-endif
-ifeq ($(OPENSSL_FLAVOR),BoringSSL)
- LOCAL_SHARED_LIBRARIES += libkeystore-engine
-endif
-
-LOCAL_CFLAGS := -DANDROID_CHANGES -DHAVE_CONFIG_H -DHAVE_OPENSSL_ENGINE_H -D_BSD_SOURCE=1
+LOCAL_CFLAGS := -DANDROID_CHANGES -DHAVE_CONFIG_H -D_BSD_SOURCE=1
LOCAL_CFLAGS += -Wno-sign-compare -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pointer-sign -Werror
@@ -95,7 +86,7 @@
src/libipsec/pfkey.c \
src/libipsec/ipsec_strerror.c
-LOCAL_CFLAGS := -DANDROID_CHANGES -DHAVE_CONFIG_H -DHAVE_OPENSSL_ENGINE_H
+LOCAL_CFLAGS := -DANDROID_CHANGES -DHAVE_CONFIG_H
LOCAL_CFLAGS += -Wno-sign-compare -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pointer-sign -Werror
diff --git a/main.c b/main.c
index a504846..c58bf57 100644
--- a/main.c
+++ b/main.c
@@ -28,8 +28,6 @@
#ifdef ANDROID_CHANGES
-#include <openssl/engine.h>
-
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -159,22 +157,10 @@
{
#ifdef ANDROID_CHANGES
int control = android_get_control_and_arguments(&argc, &argv);
-#if !defined(OPENSSL_IS_BORINGSSL)
- ENGINE *engine;
-#endif
if (control != -1) {
pname = "%p";
monitor_fd(control, NULL);
-
-#if !defined(OPENSSL_IS_BORINGSSL)
- ENGINE_load_dynamic();
- engine = ENGINE_by_id("keystore");
- if (!engine || !ENGINE_init(engine)) {
- do_plog(LLV_ERROR, "ipsec-tools: cannot load keystore engine");
- exit(1);
- }
-#endif
}
#endif
@@ -213,12 +199,6 @@
}
}
-#if !defined(OPENSSL_IS_BORINGSSL)
- if (engine) {
- ENGINE_finish(engine);
- ENGINE_free(engine);
- }
-#endif
return 0;
}