summaryrefslogtreecommitdiff
path: root/gsupplicant/supplicant.c
diff options
context:
space:
mode:
Diffstat (limited to 'gsupplicant/supplicant.c')
-rwxr-xr-xgsupplicant/supplicant.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 6cf4cf22..9ecaf069 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -317,6 +317,7 @@ struct g_supplicant_bss {
unsigned int transition_mode_ssid_len;
unsigned char transition_mode_bssid[6];
unsigned char transition_mode_ssid[32];
+ dbus_bool_t pmf_required;
#endif
};
@@ -1764,6 +1765,14 @@ const unsigned char *g_supplicant_network_get_countrycode(GSupplicantNetwork
return network->country_code;
}
+
+dbus_bool_t g_supplicant_network_is_pmf_required(GSupplicantNetwork *network)
+{
+ if (!network)
+ return 0;
+
+ return network->best_bss->pmf_required;
+}
#endif
const unsigned char *g_supplicant_peer_get_widi_ies(GSupplicantPeer *peer,
@@ -2929,6 +2938,7 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
unsigned char *ext_rates = NULL;
unsigned int max_rate = 0;
unsigned int max_ext_rate = 0;
+ unsigned int offset = 0;
bool ht = false;
bool vht = false;
#endif
@@ -2946,6 +2956,8 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
#if defined TIZEN_EXT
#define VENDOR_SPECIFIC_INFO 0xDD
#define WLAN_EID_COUNTRY 7
+#define WLAN_EID_RSN_INFO 48
+#define RSN_CAPABILITY_MFP_REQ (1 << 6)
#endif
dbus_message_iter_recurse(iter, &array);
@@ -2963,7 +2975,7 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
unsigned char *vsie;
int vsie_len = 0;
- if(ie[0] == VENDOR_SPECIFIC_INFO && memcmp(ie+2, OWE_WFA_OUI, sizeof(OWE_WFA_OUI)) == 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");
/*
@@ -2993,7 +3005,7 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
continue;
}
- if(ie[0] == VENDOR_SPECIFIC_INFO && memcmp(ie+2, WPS_OUI, sizeof(WPS_OUI)) != 0) {
+ if (ie[0] == VENDOR_SPECIFIC_INFO && memcmp(ie+2, WPS_OUI, sizeof(WPS_OUI)) != 0) {
if (!simplified_log)
SUPPLICANT_DBG("IE: match vendor specific data");
@@ -3009,7 +3021,7 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
continue;
}
- if(ie[0] == WLAN_EID_COUNTRY && ie[1] >= 2) {
+ if (ie[0] == WLAN_EID_COUNTRY && ie[1] >= 2) {
/* Add country code only if it is a valid alphabet */
if (ie[2] >= 65 && ie[2] <= 90 && ie[3] >= 65 && ie[3] <= 90) {
memcpy(bss->country_code, ie+2, COUNTRY_CODE_LENGTH);
@@ -3054,6 +3066,18 @@ static void bss_process_ies(DBusMessageIter *iter, void *user_data)
}
continue;
}
+
+ if (ie[0] == WLAN_EID_RSN_INFO && ie[1] >= 20) {
+ r_len = ie[1];
+ offset = 10 + ie[8] * 4;
+ offset += ie[offset] * 4 + 2;
+
+ if (offset <= r_len + 1 &&
+ (ie[offset] & RSN_CAPABILITY_MFP_REQ) != 0)
+ bss->pmf_required = TRUE;
+
+ continue;
+ }
#endif
if (ie[0] != WMM_WPA1_WPS_INFO || ie[1] < WPS_INFO_MIN_LEN ||
memcmp(ie+2, WPS_OUI, sizeof(WPS_OUI)) != 0)