diff options
Diffstat (limited to 'gsupplicant/supplicant.c')
-rwxr-xr-x | gsupplicant/supplicant.c | 87 |
1 files changed, 82 insertions, 5 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 2dccc951..fd0e509a 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -306,6 +306,10 @@ struct g_supplicant_bss { dbus_bool_t sae; dbus_bool_t owe; dbus_bool_t dpp; + dbus_bool_t owe_transition_mode; + unsigned int transition_mode_ssid_len; + unsigned char transition_mode_bssid[6]; + unsigned char transition_mode_ssid[32]; #endif }; @@ -334,8 +338,10 @@ struct _GSupplicantNetwork { GSList *vsie_list; unsigned char country_code[COUNTRY_CODE_LENGTH]; GSupplicantPhy_mode phy_mode; -#endif -#if defined TIZEN_EXT + dbus_bool_t owe_transition_mode; + unsigned int transition_mode_ssid_len; + unsigned char transition_mode_bssid[6]; + unsigned char transition_mode_ssid[32]; unsigned char last_connected_bssid[WIFI_BSSID_LEN_MAX]; GHashTable *assoc_reject_table; #endif @@ -1815,6 +1821,34 @@ const unsigned char *g_supplicant_network_get_bssid(GSupplicantNetwork *network) return (const unsigned char *)network->best_bss->bssid; } +dbus_bool_t g_supplicant_network_get_transition_mode(GSupplicantNetwork *network) +{ + if (network == NULL) + return FALSE; + + return network->owe_transition_mode; +} + + +const unsigned char *g_supplicant_network_get_transition_mode_bssid(GSupplicantNetwork *network) +{ + if (network == NULL) + return NULL; + + return (const unsigned char *)network->transition_mode_bssid; +} + +const void *g_supplicant_network_get_transition_mode_ssid(GSupplicantNetwork *network, + unsigned int *transition_mode_ssid_len) +{ + if (!network) { + *transition_mode_ssid_len = 0; + return NULL; + } + + *transition_mode_ssid_len = network->transition_mode_ssid_len; + return network->transition_mode_ssid; +} unsigned int g_supplicant_network_get_maxrate(GSupplicantNetwork *network) { @@ -2548,6 +2582,10 @@ static int add_or_replace_bss_to_network(struct g_supplicant_bss *bss) } #if defined TIZEN_EXT + network->owe_transition_mode = bss->owe_transition_mode; + memcpy(network->transition_mode_ssid, bss->transition_mode_ssid, bss->transition_mode_ssid_len); + memcpy(network->transition_mode_bssid, bss->transition_mode_bssid, WIFI_BSSID_LEN_MAX); + network->keymgmt = bss->keymgmt; if (g_slist_length(bss->vsie_list) > 0) { @@ -2818,6 +2856,7 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data) unsigned int value; int ie_len; #if defined TIZEN_EXT + const unsigned char OWE_WFA_OUI[] = { 0x50, 0x6f, 0x9a, 0x1c }; int r_len, j; unsigned char *rates = NULL; unsigned char *ext_rates = NULL; @@ -2856,6 +2895,37 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data) #if defined TIZEN_EXT unsigned char *vsie; int vsie_len = 0; + + if(ie[0] == VENDOR_SPECIFIC_INFO && memcmp(ie+2, OWE_WFA_OUI, sizeof(OWE_WFA_OUI)) == 0) { + SUPPLICANT_DBG("IE: match vendor specific data : OWE Transition Mode"); + +/* + Tag: Vendor Specific: Wi-Fi Alliance: OWE Transition Mode + Tag Number: Vendor Specific (221) -> ie[0] + Tag length: 26 -> ie[1] + OUI: 50:6f:9a (Wi-Fi Alliance) -> ie[2] + Vendor Specific OUI Type: 28 -> ie[5] + BSSID: 92:fd:f0:20:2b:09 -> ie[6] + SSID length: 15 -> ie[12] + SSID: Wi-Fi-5.2.3-owe -> ie[13] + +0000 dd 1a 50 6f 9a 1c 92 fd f0 20 2b 09 0f 57 69 2d ..Po..... +..Wi- +0010 46 69 2d 35 2e 32 2e 33 2d 6f 77 65 Fi-5.2.3-owe + +*/ + bss->owe_transition_mode = TRUE; + if (ie[1] >= 11) { // Tag length is at least up to ssid length position. + memcpy(bss->transition_mode_bssid, ie+6, WIFI_BSSID_LEN_MAX); + if (ie[12] > 0 && ie[12] < 32) { + memcpy(bss->transition_mode_ssid, ie+13, ie[12]); + bss->transition_mode_ssid_len = ie[12]; + } else + bss->transition_mode_ssid_len = 0; + } else + bss->owe_transition_mode = FALSE; + continue; + } + if(ie[0] == VENDOR_SPECIFIC_INFO && memcmp(ie+2, WPS_OUI, sizeof(WPS_OUI)) != 0) { SUPPLICANT_DBG("IE: match vendor specific data"); @@ -3023,7 +3093,7 @@ static void bss_compute_security(struct g_supplicant_bss *bss) bss->security = G_SUPPLICANT_SECURITY_IEEE8021X; else if (bss->sae) bss->security = G_SUPPLICANT_SECURITY_SAE; - else if (bss->owe) + else if (bss->owe || bss->owe_transition_mode) bss->security = G_SUPPLICANT_SECURITY_OWE; else if (bss->dpp) bss->security = G_SUPPLICANT_SECURITY_DPP; @@ -7043,7 +7113,10 @@ static void add_network_security(DBusMessageIter *dict, GSupplicantSSID *ssid) add_network_security_proto(dict, ssid); break; case G_SUPPLICANT_SECURITY_SAE: - key_mgmt = "SAE"; + if (ssid->keymgmt & G_SUPPLICANT_KEYMGMT_WPA_PSK) + key_mgmt = "SAE WPA-PSK"; // WFA (WPA3 & WPA2 Mixed -> WPA2 only) + else + key_mgmt = "SAE"; add_network_security_psk(dict, ssid); break; case G_SUPPLICANT_SECURITY_OWE: @@ -7126,7 +7199,11 @@ static void interface_add_network_params(DBusMessageIter *iter, void *user_data) ssid->ssid_len); #if defined TIZEN_EXT - if (ssid->bssid) { + bool owe_transition_mode = FALSE; + if ((ssid->security == G_SUPPLICANT_SECURITY_OWE) && !(ssid->keymgmt & G_SUPPLICANT_KEYMGMT_OWE)) + owe_transition_mode = TRUE; + + if (ssid->bssid && !owe_transition_mode) { char *bssid = NULL; bssid = g_try_malloc0(18); if (bssid == NULL) { |