diff options
-rwxr-xr-x | gsupplicant/gsupplicant.h | 1 | ||||
-rwxr-xr-x | gsupplicant/supplicant.c | 12 | ||||
-rwxr-xr-x | include/network.h | 3 | ||||
-rwxr-xr-x | plugins/wifi.c | 2 | ||||
-rwxr-xr-x | src/agent-connman.c | 6 | ||||
-rwxr-xr-x | src/config.c | 3 | ||||
-rwxr-xr-x | src/network.c | 17 | ||||
-rwxr-xr-x | src/service.c | 15 |
8 files changed, 59 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h index ad78c29d..e47421a4 100755 --- a/gsupplicant/gsupplicant.h +++ b/gsupplicant/gsupplicant.h @@ -359,6 +359,7 @@ const unsigned char *g_supplicant_network_get_bssid( GSupplicantNetwork *network); unsigned int g_supplicant_network_get_maxrate(GSupplicantNetwork *network); const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network); +bool g_supplicant_network_get_rsn_selected(GSupplicantNetwork *network); unsigned int g_supplicant_network_is_hs20AP(GSupplicantNetwork *network); const char *g_supplicant_network_get_eap(GSupplicantNetwork *network); const char *g_supplicant_network_get_identity(GSupplicantNetwork *network); diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index fc8fd3d9..806b4bdf 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -1292,6 +1292,18 @@ const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network) return NULL; } + +bool g_supplicant_network_get_rsn_selected(GSupplicantNetwork *network) +{ + if (network == NULL || network->best_bss == NULL) + return 0; + + if (network->best_bss->rsn_selected) + return true; + else + return false; +} + #endif static void merge_network(GSupplicantNetwork *network) diff --git a/include/network.h b/include/network.h index 97b76e5b..db25ae02 100755 --- a/include/network.h +++ b/include/network.h @@ -132,6 +132,9 @@ int connman_network_set_enc_mode(struct connman_network *network, const char *encryption_mode); const char *connman_network_get_enc_mode(struct connman_network *network); +int connman_network_set_rsn_selected(struct connman_network *network, + bool rsn_selected); + int connman_network_set_proxy(struct connman_network *network, const char *proxies); diff --git a/plugins/wifi.c b/plugins/wifi.c index e8c7ae57..66e6bd17 100755 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -2960,6 +2960,8 @@ static void network_added(GSupplicantNetwork *supplicant_network) g_supplicant_network_get_maxrate(supplicant_network)); connman_network_set_enc_mode(network, g_supplicant_network_get_enc_mode(supplicant_network)); + connman_network_set_rsn_selected(network, + g_supplicant_network_get_rsn_selected(supplicant_network)); #endif connman_network_set_available(network, true); connman_network_set_string(network, "WiFi.Mode", mode); diff --git a/src/agent-connman.c b/src/agent-connman.c index d9502a7a..177cbe0a 100755 --- a/src/agent-connman.c +++ b/src/agent-connman.c @@ -225,6 +225,9 @@ static void request_input_append_passphrase(DBusMessageIter *iter, value = "wep"; break; case CONNMAN_SERVICE_SECURITY_PSK: +#if defined TIZEN_EXT + case CONNMAN_SERVICE_SECURITY_RSN: +#endif value = "psk"; break; case CONNMAN_SERVICE_SECURITY_8021X: @@ -358,6 +361,9 @@ static void previous_passphrase_handler(DBusMessageIter *iter, data.type = "wep"; break; case CONNMAN_SERVICE_SECURITY_PSK: +#if defined TIZEN_EXT + case CONNMAN_SERVICE_SECURITY_RSN: +#endif data.type = "psk"; break; /* diff --git a/src/config.c b/src/config.c index 8ae1764d..778e57cf 100755 --- a/src/config.c +++ b/src/config.c @@ -685,6 +685,9 @@ static bool load_service(GKeyFile *keyfile, const char *group, if (str) { if (security == CONNMAN_SERVICE_SECURITY_PSK || +#if defined TIZEN_EXT + security == CONNMAN_SERVICE_SECURITY_RSN || +#endif security == CONNMAN_SERVICE_SECURITY_WEP) { service->security = security; } else { diff --git a/src/network.c b/src/network.c index 4b2ae113..0d6b442b 100755 --- a/src/network.c +++ b/src/network.c @@ -97,6 +97,7 @@ struct connman_network { unsigned char bssid[WIFI_BSSID_LEN_MAX]; unsigned int maxrate; unsigned int isHS20AP; + bool rsn_selected; #endif } wifi; @@ -1875,6 +1876,14 @@ const char *connman_network_get_enc_mode(struct connman_network *network) return (const char *)network->wifi.encryption_mode; } +int connman_network_set_rsn_selected(struct connman_network *network, + bool rsn_selected) +{ + network->wifi.rsn_selected = rsn_selected; + + return 0; +} + int connman_network_set_proxy(struct connman_network *network, const char *proxies) { @@ -2125,7 +2134,15 @@ const char *connman_network_get_string(struct connman_network *network, else if (g_str_equal(key, "WiFi.Mode")) return network->wifi.mode; else if (g_str_equal(key, "WiFi.Security")) +#if defined TIZEN_EXT + if (network->wifi.rsn_selected != true || + g_str_equal(network->wifi.security, "ieee8021x")) + return network->wifi.security; + else + return "rsn"; +#else return network->wifi.security; +#endif else if (g_str_equal(key, "WiFi.Passphrase")) return network->wifi.passphrase; else if (g_str_equal(key, "WiFi.EAP")) diff --git a/src/service.c b/src/service.c index ca291199..b424bd5c 100755 --- a/src/service.c +++ b/src/service.c @@ -327,6 +327,10 @@ enum connman_service_security __connman_service_string2security(const char *str) return CONNMAN_SERVICE_SECURITY_NONE; if (!strcmp(str, "wep")) return CONNMAN_SERVICE_SECURITY_WEP; +#if defined TIZEN_EXT + if (!strcmp(str, "rsn")) + return CONNMAN_SERVICE_SECURITY_RSN; +#endif return CONNMAN_SERVICE_SECURITY_UNKNOWN; } @@ -342,8 +346,14 @@ static const char *security2string(enum connman_service_security security) return "wep"; case CONNMAN_SERVICE_SECURITY_PSK: case CONNMAN_SERVICE_SECURITY_WPA: +#if defined TIZEN_EXT + return "psk"; + case CONNMAN_SERVICE_SECURITY_RSN: + return "rsn"; +#else case CONNMAN_SERVICE_SECURITY_RSN: return "psk"; +#endif case CONNMAN_SERVICE_SECURITY_8021X: return "ieee8021x"; } @@ -3377,7 +3387,9 @@ static int check_passphrase(enum connman_service_security security, case CONNMAN_SERVICE_SECURITY_UNKNOWN: case CONNMAN_SERVICE_SECURITY_NONE: case CONNMAN_SERVICE_SECURITY_WPA: +#if !defined TIZEN_EXT case CONNMAN_SERVICE_SECURITY_RSN: +#endif DBG("service security '%s' (%d) not handled", security2string(security), security); @@ -3385,6 +3397,9 @@ static int check_passphrase(enum connman_service_security security, return -EOPNOTSUPP; case CONNMAN_SERVICE_SECURITY_PSK: +#if defined TIZEN_EXT + case CONNMAN_SERVICE_SECURITY_RSN: +#endif /* A raw key is always 64 bytes length, * its content is in hex representation. * A PSK key must be between [8..63]. |