const char *prop_vsie_list = "vsie_list";
const char *prop_sec = "security";
const char *prop_enc = "encryption";
+ const char *prop_pmf = "pmf";
bss_info_list = g_slist_sort(bss_info_list, __netconfig_compare_bss_by_rssi);
int signal = (int)bss_info->signal;
int sec_type = (int)bss_info->security_type;
int enc_type = (int)bss_info->encryption_type;
+ int pmf_required = (int)bss_info->pmf_required;
g_variant_builder_add(builder, "{sv}", prop_ssid, g_variant_new_string(ssid));
g_variant_builder_add(builder, "{sv}", prop_bssid, g_variant_new_string(bssid));
g_variant_builder_add(builder, "{sv}", prop_sec, g_variant_new_int32(sec_type));
g_variant_builder_add(builder, "{sv}", prop_enc, g_variant_new_int32(enc_type));
+ g_variant_builder_add(builder, "{sv}", prop_pmf, g_variant_new_int32(pmf_required));
}
}
{
int *ret = user_data;
*ret = 0;
+
+ DBG("");
return NL_SKIP;
}
{
int *ret = user_data;
*ret = err->error;
- return NL_SKIP;
+
+ DBG("");
+ return NL_STOP;
}
static int no_seq_check(struct nl_msg *msg, void *user_data)
static unsigned char ms_oui[3] = { 0x00, 0x50, 0xf2 };
static unsigned char ieee80211_oui[3] = { 0x00, 0x0f, 0xac };
-static void __netconfig_get_security(unsigned char *bss_element, int length, wifi_security_type_e *sec_type, wifi_encryption_type_e *enc_type)
+static void __netconfig_get_security(unsigned char *bss_element, int length,
+ wifi_security_type_e *sec_type, wifi_encryption_type_e *enc_type, int *pmf_required)
{
int i;
unsigned char *data;
if (t_data[3] == 1 || t_data[3] == 3 || t_data[3] == 5) { // 1 : IEEE 802.1X, 3 : FT/IEEE 802.1X, 5 : IEEE 802.1X/SHA-256
*sec_type = WIFI_SECURITY_TYPE_EAP;
} else if (t_data[3] == 2 || t_data[3] == 4 || t_data[3] == 6) { // 2 : PSK, 4 : FT/PSK, 6 : PSK/SHA-256
+ if (t_data[3] == 6)
+ *pmf_required = 1;
if (*sec_type != WIFI_SECURITY_TYPE_WPA2_PSK)
*sec_type = WIFI_SECURITY_TYPE_WPA_PSK;
}
if (t_data[3] == 1 || t_data[3] == 3 || t_data[3] == 5) { // 1 : IEEE 802.1X, 3 : FT/IEEE 802.1X, 5 : IEEE 802.1X/SHA-256
*sec_type = WIFI_SECURITY_TYPE_EAP;
} else if (t_data[3] == 2 || t_data[3] == 4 || t_data[3] == 6) { // 2 : PSK, 4 : FT/PSK, 6 : PSK/SHA-256
+ if (t_data[3] == 6)
+ *pmf_required = 1;
*sec_type = WIFI_SECURITY_TYPE_WPA2_PSK;
ieee80211_psk = true;
} else if (t_data[3] == 8) { // Add SAE security type for netlink scan
[NL80211_BSS_SIGNAL_MBM] = {.type = NLA_U32},
};
+ int pmf_needed = 0;
+
/** Parse nl message and check error. */
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL);
if (!tb[NL80211_ATTR_BSS]) {
}
}
__netconfig_get_security(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]),
- nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]), &sec_type, &enc_type);
+ nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]), &sec_type, &enc_type, &pmf_needed);
if (wep_check && sec_type == WIFI_SECURITY_TYPE_NONE) {
sec_type = WIFI_SECURITY_TYPE_WEP;
bss_info->security_type = sec_type;
bss_info->encryption_type = enc_type;
- DBG("%s %d %d %s %d %d ", bss_info->bssid, bss_info->freq,
+ bss_info->pmf_required = pmf_needed;
+ SECURE_LOGD("%s %d %d %s %d %d %d ", bss_info->bssid, bss_info->freq,
bss_info->signal, bss_info->ssid, bss_info->security_type,
- bss_info->encryption_type);
+ bss_info->encryption_type, bss_info->pmf_required);
if (bss_info->ssid[0] == '\0')
g_free(bss_info);
}
}
+ if (err < 0) {
+ DBG("error code = %d", err);
+ ret = -1;
+ goto out;
+ }
+
while (!results.done) {
ret = nl_recvmsgs(socket, cb);
#if !defined TIZEN_WEARABLE