summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2018-02-15 11:19:26 (GMT)
committertaesub kim <taesub.kim@samsung.com>2018-02-26 08:44:08 (GMT)
commitca78e0cbb13bbd69de43f9a5d3f05d9ce51f58d1 (patch)
tree5d8a26eec5bd319d09ef2aaf9b5d6395bf92c6c8
parent63d4f774d04c381000e45e7490bc838da9b36027 (diff)
downloadconnman-ca78e0cbb13bbd69de43f9a5d3f05d9ce51f58d1.zip
connman-ca78e0cbb13bbd69de43f9a5d3f05d9ce51f58d1.tar.gz
connman-ca78e0cbb13bbd69de43f9a5d3f05d9ce51f58d1.tar.bz2
Change-Id: Ibb75ff2c2e54c8d3d53f3b184502647918bf7e24 igned-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rwxr-xr-xgsupplicant/gsupplicant.h12
-rw-r--r--gsupplicant/supplicant.c43
-rwxr-xr-xplugins/wifi.c29
-rwxr-xr-xsrc/network.c4
-rwxr-xr-xsrc/service.c20
5 files changed, 103 insertions, 5 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 0476ff6..ead619c 100755
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -108,6 +108,15 @@ typedef enum {
#endif
} GSupplicantSecurity;
+#if defined TIZEN_EXT
+typedef enum {
+ G_SUPPLICANT_EAP_KEYMGMT_NONE,
+ G_SUPPLICANT_EAP_KEYMGMT_FT,
+ G_SUPPLICANT_EAP_KEYMGMT_CCKM,
+ G_SUPPLICANT_EAP_KEYMGMT_OKC,
+} GSupplicantEapKeymgmt;
+#endif
+
typedef enum {
G_SUPPLICANT_STATE_UNKNOWN,
G_SUPPLICANT_STATE_DISABLED,
@@ -175,6 +184,9 @@ struct _GSupplicantSSID {
unsigned char *bssid;
unsigned int bssid_for_connect_len;
unsigned char bssid_for_connect[6];
+ GSupplicantEapKeymgmt eap_keymgmt;
+ const char *phase1;
+ const char *pac_file;
#endif
};
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 9b7a934..92efbc9 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -5131,6 +5131,33 @@ static void add_network_security_aka_sim(DBusMessageIter *dict,
DBUS_TYPE_STRING,
&ssid->passphrase);
}
+
+static void add_network_security_fast(DBusMessageIter *dict,
+ GSupplicantSSID *ssid)
+{
+ /*
+ * For FAST, we at least need:
+ * id / password
+ * phase1 (provisiong information)
+ * pac_file
+ */
+
+ /* Allow provisioing both authenticated and unauthenticated */
+ const char *phase1 = "fast_provisioning=2";
+ supplicant_dbus_dict_append_basic(dict, "phase1",
+ DBUS_TYPE_STRING,
+ &phase1);
+
+ SUPPLICANT_DBG("pac_file [%s]", ssid->pac_file);
+ if(ssid->pac_file)
+ supplicant_dbus_dict_append_basic(dict, "pac_file",
+ DBUS_TYPE_STRING,
+ &ssid->pac_file);
+
+ supplicant_dbus_dict_append_basic(dict, "password",
+ DBUS_TYPE_STRING,
+ &ssid->passphrase);
+}
#endif
static void add_network_security_eap(DBusMessageIter *dict,
@@ -5157,8 +5184,20 @@ static void add_network_security_eap(DBusMessageIter *dict,
#if defined TIZEN_EXT
} else if (g_strcmp0(ssid->eap, "sim") == 0 ||
- g_strcmp0(ssid->eap, "aka") == 0) {
+ g_strcmp0(ssid->eap, "aka") == 0 ||
+ g_strcmp0(ssid->eap, "aka'") == 0) {
add_network_security_aka_sim(dict, ssid);
+ } else if (g_strcmp0(ssid->eap, "pwd") == 0) {
+ if(!ssid->passphrase)
+ return;
+ supplicant_dbus_dict_append_basic(dict, "password",
+ DBUS_TYPE_STRING,
+ &ssid->passphrase);
+ } else if (g_strcmp0(ssid->eap, "fast") == 0){
+ if (!ssid->identity || !ssid->passphrase)
+ return;
+
+ add_network_security_fast(dict, ssid);
#endif
} else
return;
@@ -5738,7 +5777,7 @@ int g_supplicant_interface_connect(GSupplicantInterface *interface,
network_remove(intf_data);
} else
#if defined TIZEN_EXT
- if (ssid->passphrase && g_strcmp0(ssid->passphrase, "") != 0) {
+ if (ssid->passphrase && g_strcmp0(ssid->passphrase, "") != 0 && !ssid->eap) {
ret = send_decryption_request(ssid->passphrase, data);
if (ret < 0)
SUPPLICANT_DBG("Decryption request failed %d", ret);
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 3d7636c..ebbd6b8 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -74,6 +74,10 @@
#define ASSOC_STATUS_NO_CLIENT 17
#define LOAD_SHAPING_MAX_RETRIES 3
+#if defined TIZEN_EXT
+#define WIFI_EAP_FAST_PAC_FILE "/var/lib/wifi/wifi.pac" /* path of Pac file for EAP-FAST */
+#endif
+
static struct connman_technology *wifi_technology = NULL;
static struct connman_technology *p2p_technology = NULL;
@@ -2442,6 +2446,21 @@ static GSupplicantSecurity network_security(const char *security)
return G_SUPPLICANT_SECURITY_UNKNOWN;
}
+#if defined TIZEN_EXT
+static GSupplicantEapKeymgmt network_eap_keymgmt(const char *security)
+{
+ if (security == NULL)
+ return G_SUPPLICANT_EAP_KEYMGMT_NONE;
+
+ if (g_str_equal(security, "FT") == TRUE)
+ return G_SUPPLICANT_EAP_KEYMGMT_FT;
+ else if (g_str_equal(security, "CCKM") == TRUE)
+ return G_SUPPLICANT_EAP_KEYMGMT_CCKM;
+
+ return G_SUPPLICANT_EAP_KEYMGMT_NONE;
+}
+#endif
+
static void ssid_init(GSupplicantSSID *ssid, struct connman_network *network)
{
const char *security;
@@ -2500,8 +2519,14 @@ static void ssid_init(GSupplicantSSID *ssid, struct connman_network *network)
#if defined TIZEN_EXT
ssid->bssid = connman_network_get_bssid(network);
-#endif
-#if defined TIZEN_EXT
+
+ ssid->eap_keymgmt = network_eap_keymgmt(
+ connman_network_get_string(network, "WiFi.KeymgmtType"));
+ ssid->phase1 = connman_network_get_string(network, "WiFi.Phase1");
+
+ if(g_strcmp0(ssid->eap, "fast") == 0)
+ ssid->pac_file = g_strdup(WIFI_EAP_FAST_PAC_FILE);
+
if (set_connman_bssid(CHECK_BSSID, NULL) == 6) {
ssid->bssid_for_connect_len = 6;
set_connman_bssid(GET_BSSID, (char *)ssid->bssid_for_connect);
diff --git a/src/network.c b/src/network.c
index cf74b6d..0e3d4b3 100755
--- a/src/network.c
+++ b/src/network.c
@@ -115,6 +115,10 @@ struct connman_network {
int disconnect_reason;
int assoc_status_code;
GSList *vsie_list;
+ /*
+ * Only for EAP-FAST
+ */
+ char *phase1;
#endif
} wifi;
diff --git a/src/service.c b/src/service.c
index 9510def..c3bdc0e 100755
--- a/src/service.c
+++ b/src/service.c
@@ -167,6 +167,10 @@ struct connman_service {
char *keymgmt_type;
int disconnect_reason;
int assoc_status_code;
+ /*
+ * Only for EAP-FAST
+ */
+ char *phase1;
#endif
#ifdef TIZEN_EXT
enum connman_dnsconfig_method dns_config_method_ipv4;
@@ -7945,6 +7949,17 @@ static void prepare_8021x(struct connman_service *service)
if (service->phase2)
connman_network_set_string(service->network, "WiFi.Phase2",
service->phase2);
+
+#if defined TIZEN_EXT
+ if (service->keymgmt_type)
+ connman_network_set_string(service->network, "WiFi.KeymgmtType",
+ service->keymgmt_type);
+
+ DBG("service->phase1 : %s", service->phase1);
+ if (service->phase1)
+ connman_network_set_string(service->network, "WiFi.Phase1",
+ service->phase1);
+#endif
}
static int service_connect(struct connman_service *service)
@@ -8032,7 +8047,10 @@ static int service_connect(struct connman_service *service)
DBG("service eap: %s", service->eap);
if (g_str_equal(service->eap, "tls") ||
g_str_equal(service->eap, "sim") ||
- g_str_equal(service->eap, "aka"))
+ g_str_equal(service->eap, "aka") ||
+ g_str_equal(service->eap, "aka'") ||
+ g_str_equal(service->eap, "pwd") ||
+ g_str_equal(service->eap, "fast"))
break;
#else
/*