unsigned int transition_mode_ssid_len;
unsigned char transition_mode_bssid[6];
unsigned char transition_mode_ssid[32];
+ dbus_bool_t pmf_required;
#endif
};
if ((ssid->security == G_SUPPLICANT_SECURITY_WEP ||
ssid->security == G_SUPPLICANT_SECURITY_PSK ||
+#if defined TIZEN_EXT
+ ssid->security == G_SUPPLICANT_SECURITY_SAE ||
+#endif
ssid->security == G_SUPPLICANT_SECURITY_NONE) &&
ssid->passphrase) {
interface->network_info.passphrase = g_strdup(ssid->passphrase);
return network->signal;
}
+#if defined TIZEN_EXT
+void g_supplicant_network_set_signal(GSupplicantNetwork *network, int signal)
+{
+ if (!network)
+ return;
+
+ network->signal = (dbus_int16_t)signal;
+}
+
+void g_supplicant_network_set_bss_signal(GSupplicantNetwork *network,
+ int signal, int snr)
+{
+ struct g_supplicant_bss *best_bss;
+
+ if (!network)
+ return;
+
+ best_bss = network->best_bss;
+ if (!best_bss)
+ return;
+
+ best_bss->signal = (dbus_int16_t)signal;
+ best_bss->snr = (dbus_int16_t)snr;
+}
+#endif
+
dbus_uint16_t g_supplicant_network_get_frequency(GSupplicantNetwork *network)
{
if (!network)
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,
return g_hash_table_lookup(interface->network_table, group);
}
+
+static void copy_assoc_reject(gpointer key, gpointer value, gpointer user_data)
+{
+ struct assoc_reject_data *cloned_assoc_data;
+ struct assoc_reject_data *assoc_data = value;
+ GHashTable *cloned_assoc_reject_table = user_data;
+
+ if (assoc_data && cloned_assoc_reject_table) {
+ cloned_assoc_data = g_try_new0(struct assoc_reject_data, 1);
+ if (!cloned_assoc_data)
+ return;
+
+ cloned_assoc_data->bssid = g_strdup(assoc_data->bssid);
+ cloned_assoc_data->reject_time_list = g_slist_copy(assoc_data->reject_time_list);
+ g_hash_table_insert(cloned_assoc_reject_table,
+ cloned_assoc_data->bssid, cloned_assoc_data);
+ }
+}
+
+GHashTable *g_supplicant_network_clone_assoc_reject_table(GSupplicantNetwork *network)
+{
+ GHashTable *cloned_assoc_reject_table;
+
+ if (!network)
+ return NULL;
+
+ GHashTable *assoc_reject_table = g_supplicant_network_get_assoc_reject_table(network);
+ if (!assoc_reject_table)
+ return NULL;
+
+ cloned_assoc_reject_table = g_hash_table_new_full(g_str_hash, g_str_equal,
+ NULL, remove_assoc_data);
+ g_hash_table_foreach(assoc_reject_table, copy_assoc_reject, cloned_assoc_reject_table);
+
+ return cloned_assoc_reject_table;
+}
+
#endif
static void merge_network(GSupplicantNetwork *network)
#endif
if (score_new > score_best) {
- SUPPLICANT_DBG("new[" MACSTR "][%u] : best[" MACSTR "][%u]",
+ SUPPLICANT_DBG("new[" MACSTR "][%d] : best[" MACSTR "][%d]",
MAC2STR(bss->bssid), score_new,
MAC2STR(network->best_bss->bssid), score_best);
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
#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);
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");
/*
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");
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);
}
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)
GSupplicantNetwork *network;
struct g_supplicant_bss *bss;
const char *path;
+#if defined TIZEN_EXT
+ char bssid_buff1[WIFI_BSSID_STR_LEN] = {0,};
+ char bssid_buff2[WIFI_BSSID_STR_LEN] = {0,};
+ char *bssid_str1 = bssid_buff1;
+ char *bssid_str2 = bssid_buff2;
+ gboolean update = FALSE;
+#endif
dbus_message_iter_get_basic(iter, &path);
if (g_strcmp0(path, "/") == 0) {
interface->current_network = network;
#if defined TIZEN_EXT
- SUPPLICANT_DBG("current network [%p]", interface->current_network);
+ snprintf(bssid_str1, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(bss->bssid));
+ snprintf(bssid_str2, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(network->best_bss->bssid));
+
+ SUPPLICANT_DBG("current network [%p], Passed bss %s, best bss %s",
+ interface->current_network, bssid_str1, bssid_str2);
+
+ if (network->frequency != bss->frequency) {
+ network->frequency = bss->frequency;
+ update = TRUE;
+ }
#endif
if (bss != network->best_bss) {
network->best_bss = bss;
-#if defined TIZEN_EXT
- if (network->frequency != bss->frequency)
- network->frequency = bss->frequency;
-#endif
-
if (network->signal != bss->signal) {
SUPPLICANT_DBG("New network signal %d dBm",
bss->signal);
network->signal = bss->signal;
callback_network_changed(network, "Signal");
- }
#if defined TIZEN_EXT
- else
- callback_network_changed(network, "");
+ update = FALSE;
+ } else {
+ update = TRUE;
#endif
+ }
}
+#if defined TIZEN_EXT
+ if (update)
+ callback_network_changed(network, "");
+#endif
+
/*
* wpa_s could notify about CurrentBSS in any state once
* it got associated. It is not sure such notification will
regdom->callback(result, regdom->alpha2,
(void *) regdom->user_data);
- dbus_free(regdom);
+ g_free(regdom);
}
static void country_params(DBusMessageIter *iter, void *user_data)
SUPPLICANT_DBG("");
if (error) {
- g_message("error %s", error);
+ g_warning("error %s", error);
err = -EIO;
goto done;
}
if (!ssid->private_key_path)
return;
-#if !defined TIZEN_EXT
if (!ssid->private_key_passphrase)
return;
-#endif
if (ssid->ca_cert_path)
supplicant_dbus_dict_append_basic(dict, "ca_cert",
supplicant_dbus_dict_append_basic(dict, "private_key",
DBUS_TYPE_STRING,
&ssid->private_key_path);
-#if !defined TIZEN_EXT
supplicant_dbus_dict_append_basic(dict, "private_key_passwd",
DBUS_TYPE_STRING,
&ssid->private_key_passphrase);
-#endif
supplicant_dbus_dict_append_basic(dict, "client_cert",
DBUS_TYPE_STRING,
&ssid->client_cert_path);