From 9eae31e78eca2cc6be8315d659e670a58ea46f43 Mon Sep 17 00:00:00 2001 From: Fabien Marotte Date: Tue, 17 Aug 2010 15:03:57 +0200 Subject: [PATCH] Add support for EAP-TTLS configuration EAP-TTLS and EAP-PEAP are similar in terms of options to pass to wpa_supplicant. So in case of TTLS, the PEAP path is used. --- doc/config-format.txt | 16 ++++++++++++---- plugins/supplicant.c | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/config-format.txt b/doc/config-format.txt index 5884550..9424896 100644 --- a/doc/config-format.txt +++ b/doc/config-format.txt @@ -29,7 +29,7 @@ to store the different services into an hash table. Allowed fields: - Type: Service type. We currently only support wifi. - SSID: An hexadecimal or a string representation of a 802.11 SSID. -- EAP: EAP type. We currently only support tls or peap. +- EAP: EAP type. We currently only support tls, ttls or peap. - CACertFile: File path to CA certificate file (PEM/DER). - ClientCertFile: File path to client certificate file (PEM/DER). - PrivateKeyFile: File path to client private key file (PEM/DER/PFX). @@ -46,10 +46,10 @@ to fsid. Example ======= -This is a configuration file for a network providing both EAP-TLS and +This is a configuration file for a network providing EAP-TLS, EAP-TTLS and EAP-PEAP services. -The respective SSIDs are tls_ssid and peap_ssid and the file name is -example.config. +The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid and the file name +is example.config. example@example:[~]$ cat /var/lib/connman/example.config [global] @@ -66,6 +66,14 @@ PrivateKeyFile = /home/user/.certs/client.fsid.pem PrivateKeyPassphraseType = fsid Identity = user +[service_ttls] +Type = wifi +Name = ttls_ssid +EAP = ttls +CACertFile = /home/user/.cert/ca.pem +Phase2 = MSCHAPV2 +Identity = user + [service_peap] Type = wifi Name = peap_ssid diff --git a/plugins/supplicant.c b/plugins/supplicant.c index 85016ba..7e2a2e5 100644 --- a/plugins/supplicant.c +++ b/plugins/supplicant.c @@ -1262,7 +1262,8 @@ static int set_network(struct supplicant_task *task, dbus_message_unref(message); return err; } - } else if (g_strcmp0(eap, "peap") == 0) { + } else if (g_strcmp0(eap, "peap") == 0 || + g_strcmp0(eap, "ttls") == 0) { int err; err = set_network_peap(network, &dict, passphrase); -- 2.7.4