aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-08-09 19:13:34 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-09 20:18:31 (GMT)
commit37f8b9da1a7759186b5d70e2e6c50d400ce41ced (patch)
treee008ebd9a84494441412f1ed68d8fc58f13a88e7
parent9c7bbe7ba1bb8713333454015d990298021c4857 (diff)
downloadhostap-37f8b9da1a7759186b5d70e2e6c50d400ce41ced.zip
hostap-37f8b9da1a7759186b5d70e2e6c50d400ce41ced.tar.gz
hostap-37f8b9da1a7759186b5d70e2e6c50d400ce41ced.tar.bz2
AOSP: OpenSSL engine/keystore
-rw-r--r--hostapd/Android.mk5
-rw-r--r--src/crypto/tls_openssl.c9
-rw-r--r--wpa_supplicant/Android.mk5
3 files changed, 11 insertions, 8 deletions
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 543c152..9ce0816 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -32,14 +32,11 @@ endif
# To allow non-ASCII characters in SSID
L_CFLAGS += -DWPA_UNICODE_SSID
-# OpenSSL is configured without engines on Android
-L_CFLAGS += -DOPENSSL_NO_ENGINE
-
INCLUDES = $(LOCAL_PATH)
INCLUDES += $(LOCAL_PATH)/src
INCLUDES += $(LOCAL_PATH)/src/utils
INCLUDES += external/openssl/include
-INCLUDES += frameworks/base/cmds/keystore
+INCLUDES += system/security/keystore
ifdef CONFIG_DRIVER_NL80211
INCLUDES += external/libnl-headers
endif
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index 772f0b2..aaa920b 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -10,9 +10,11 @@
#ifndef CONFIG_SMARTCARD
#ifndef OPENSSL_NO_ENGINE
+#ifndef ANDROID
#define OPENSSL_NO_ENGINE
#endif
#endif
+#endif
#include <openssl/ssl.h>
#include <openssl/err.h>
@@ -793,16 +795,21 @@ static int tls_engine_init(struct tls_connection *conn, const char *engine_id,
wpa_printf(MSG_ERROR, "ENGINE: Engine ID not set");
return -1;
}
+#ifndef ANDROID
if (pin == NULL) {
wpa_printf(MSG_ERROR, "ENGINE: Smartcard PIN not set");
return -1;
}
+#endif
if (key_id == NULL) {
wpa_printf(MSG_ERROR, "ENGINE: Key Id not set");
return -1;
}
ERR_clear_error();
+#ifdef ANDROID
+ ENGINE_load_dynamic();
+#endif
conn->engine = ENGINE_by_id(engine_id);
if (!conn->engine) {
wpa_printf(MSG_ERROR, "ENGINE: engine %s not available [%s]",
@@ -817,11 +824,13 @@ static int tls_engine_init(struct tls_connection *conn, const char *engine_id,
}
wpa_printf(MSG_DEBUG, "ENGINE: engine initialized");
+#ifndef ANDROID
if (ENGINE_ctrl_cmd_string(conn->engine, "PIN", pin, 0) == 0) {
wpa_printf(MSG_ERROR, "ENGINE: cannot set pin [%s]",
ERR_error_string(ERR_get_error(), NULL));
goto err;
}
+#endif
/* load private key first in-case PIN is required for cert */
conn->private_key = ENGINE_load_private_key(conn->engine,
key_id, NULL, NULL);
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index e611d36..8d23557 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -43,9 +43,6 @@ endif
# To allow non-ASCII characters in SSID
L_CFLAGS += -DWPA_UNICODE_SSID
-# OpenSSL is configured without engines on Android
-L_CFLAGS += -DOPENSSL_NO_ENGINE
-
INCLUDES = $(LOCAL_PATH)
INCLUDES += $(LOCAL_PATH)/src
INCLUDES += $(LOCAL_PATH)/src/common
@@ -63,7 +60,7 @@ INCLUDES += $(LOCAL_PATH)/src/tls
INCLUDES += $(LOCAL_PATH)/src/utils
INCLUDES += $(LOCAL_PATH)/src/wps
INCLUDES += external/openssl/include
-INCLUDES += frameworks/base/cmds/keystore
+INCLUDES += system/security/keystore
ifdef CONFIG_DRIVER_NL80211
INCLUDES += external/libnl-headers
endif