aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/interworking.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-09-28 14:12:27 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-28 14:12:27 (GMT)
commit93face0e06dbaa648af6a6681290658e989c2e53 (patch)
treeae3d37440356129dafee99bb0725e13dbe31d77a /wpa_supplicant/interworking.c
parentfa5c5b43e4b169dbd530c74e5e388a630901dc6e (diff)
downloadhostap-93face0e06dbaa648af6a6681290658e989c2e53.zip
hostap-93face0e06dbaa648af6a6681290658e989c2e53.tar.gz
hostap-93face0e06dbaa648af6a6681290658e989c2e53.tar.bz2
Interworking: Support Android JB keystore with EAP-TLS
If the keystore:// prefix is used in the private_key entry, convert that to the OpenSSL engine style configuration used for Android JB keystore. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/interworking.c')
-rw-r--r--wpa_supplicant/interworking.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 22f709f..8e870f6 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -1046,6 +1046,17 @@ static int interworking_set_eap_params(struct wpa_ssid *ssid,
wpa_config_set_quoted(ssid, "client_cert", cred->client_cert) < 0)
return -1;
+#ifdef ANDROID
+ if (cred->private_key &&
+ os_strncmp(cred->private_key, "keystore://", 11) == 0) {
+ /* Use OpenSSL engine configuration for Android keystore */
+ if (wpa_config_set_quoted(ssid, "engine_id", "keystore") < 0 ||
+ wpa_config_set_quoted(ssid, "key_id",
+ cred->private_key + 11) < 0 ||
+ wpa_config_set(ssid, "engine", "1", 0) < 0)
+ return -1;
+ } else
+#endif /* ANDROID */
if (cred->private_key && cred->private_key[0] &&
wpa_config_set_quoted(ssid, "private_key", cred->private_key) < 0)
return -1;