summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgsupplicant/gsupplicant.h1
-rwxr-xr-xgsupplicant/supplicant.c32
-rwxr-xr-xplugins/wifi.c11
-rwxr-xr-xsrc/connman.h5
-rwxr-xr-xsrc/network.c16
5 files changed, 64 insertions, 1 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 5c3218be..9e8f6e00 100755
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -127,6 +127,7 @@ typedef enum {
G_SUPPLICANT_SECURITY_SAE,
G_SUPPLICANT_SECURITY_OWE,
G_SUPPLICANT_SECURITY_DPP,
+ G_SUPPLICANT_SECURITY_PSK_SHA256,
#endif
} GSupplicantSecurity;
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 7a55b216..c90adabc 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -306,6 +306,7 @@ struct g_supplicant_bss {
GSupplicantPhy_mode phy_mode;
dbus_int16_t snr;
dbus_uint32_t est_throughput;
+ dbus_bool_t psk_sha256;
#endif
unsigned int wps_capabilities;
#if defined TIZEN_EXT
@@ -552,6 +553,8 @@ static const char *security2string(GSupplicantSecurity security)
case G_SUPPLICANT_SECURITY_IEEE8021X:
return "ieee8021x";
#if defined TIZEN_EXT
+ case G_SUPPLICANT_SECURITY_PSK_SHA256:
+ return "psk_sha256";
case G_SUPPLICANT_SECURITY_FT_PSK:
return "ft_psk";
case G_SUPPLICANT_SECURITY_FT_IEEE8021X:
@@ -681,6 +684,7 @@ static int store_network_information(GSupplicantInterface * interface,
if ((ssid->security == G_SUPPLICANT_SECURITY_WEP ||
ssid->security == G_SUPPLICANT_SECURITY_PSK ||
+ ssid->security == G_SUPPLICANT_SECURITY_PSK_SHA256 ||
ssid->security == G_SUPPLICANT_SECURITY_NONE) &&
ssid->passphrase) {
interface->network_info.passphrase = g_strdup(ssid->passphrase);
@@ -1902,6 +1906,7 @@ const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network)
network->best_bss->security == G_SUPPLICANT_SECURITY_SAE ||
network->best_bss->security == G_SUPPLICANT_SECURITY_OWE ||
network->best_bss->security == G_SUPPLICANT_SECURITY_DPP ||
+ network->best_bss->security == G_SUPPLICANT_SECURITY_PSK_SHA256 ||
#endif /* TIZEN_EXT */
network->best_bss->security == G_SUPPLICANT_SECURITY_IEEE8021X) {
unsigned int pairwise;
@@ -2570,8 +2575,14 @@ static char *create_group(struct g_supplicant_bss *bss)
mode = mode2string(bss->mode);
if (mode)
g_string_append_printf(str, "_%s", mode);
-
+#if defined TIZEN_EXT
+ if (bss->security == G_SUPPLICANT_SECURITY_PSK_SHA256)
+ security = "psk";
+ else
+ security = security2string(bss->security);
+#else
security = security2string(bss->security);
+#endif
if (security)
g_string_append_printf(str, "_%s", security);
@@ -3152,6 +3163,13 @@ static void bss_compute_security(struct g_supplicant_bss *bss)
#if defined TIZEN_EXT
if (bss->keymgmt &
+ G_SUPPLICANT_KEYMGMT_WPA_PSK_256) {
+ bss->psk_sha256 = TRUE;
+ }
+#endif
+
+#if defined TIZEN_EXT
+ if (bss->keymgmt &
(G_SUPPLICANT_KEYMGMT_WPA_PSK |
G_SUPPLICANT_KEYMGMT_WPA_PSK_256))
bss->psk = TRUE;
@@ -3179,6 +3197,8 @@ static void bss_compute_security(struct g_supplicant_bss *bss)
#if defined TIZEN_EXT
else if (bss->sae)
bss->security = G_SUPPLICANT_SECURITY_SAE;
+ else if (bss->psk_sha256)
+ bss->security = G_SUPPLICANT_SECURITY_PSK_SHA256;
#endif
else if (bss->psk)
bss->security = G_SUPPLICANT_SECURITY_PSK;
@@ -7175,6 +7195,7 @@ static void add_network_ieee80211w(DBusMessageIter *dict, GSupplicantSSID *ssid)
{
if (ssid->security != G_SUPPLICANT_SECURITY_SAE
&& ssid->security != G_SUPPLICANT_SECURITY_OWE
+ && ssid->security != G_SUPPLICANT_SECURITY_PSK_SHA256
&& ssid->security != G_SUPPLICANT_SECURITY_DPP)
return;
@@ -7276,6 +7297,15 @@ static void add_network_security(DBusMessageIter *dict, GSupplicantSSID *ssid)
add_network_security_proto(dict, ssid);
break;
#if defined TIZEN_EXT
+ case G_SUPPLICANT_SECURITY_PSK_SHA256:
+ if (ssid->keymgmt & G_SUPPLICANT_KEYMGMT_WPA_PSK)
+ key_mgmt = "WPA-PSK-SHA256 WPA-PSK";
+ else
+ key_mgmt = "WPA-PSK-SHA256";
+ add_network_security_psk(dict, ssid);
+ add_network_security_ciphers(dict, ssid);
+ add_network_security_proto(dict, ssid);
+ break;
case G_SUPPLICANT_SECURITY_FT_PSK:
key_mgmt = "FT-PSK";
add_network_security_psk(dict, ssid);
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 92e5a64d..7b831ffe 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -3561,6 +3561,8 @@ static GSupplicantSecurity network_security(const char *security)
return G_SUPPLICANT_SECURITY_OWE;
else if (g_str_equal(security, "dpp"))
return G_SUPPLICANT_SECURITY_DPP;
+ else if (g_str_equal(security, "psk_sha256") == TRUE)
+ return G_SUPPLICANT_SECURITY_PSK_SHA256;
#endif
return G_SUPPLICANT_SECURITY_UNKNOWN;
@@ -3605,6 +3607,10 @@ static void ssid_init(GSupplicantSSID *ssid, struct connman_network *network)
#endif
ssid->scan_ssid = 1;
security = connman_network_get_string(network, "WiFi.Security");
+#if defined TIZEN_EXT
+ if (connman_network_get_psk_sha256(network))
+ security = "psk_sha256";
+#endif
ssid->security = network_security(security);
#if defined TIZEN_EXT
ssid->ieee80211w = 1;
@@ -5008,6 +5014,11 @@ static void network_added(GSupplicantNetwork *supplicant_network)
connman_network_set_countrycode(network, country_code);
phy_mode = g_supplicant_network_get_phy_mode(supplicant_network);
connman_network_set_phy_mode(network, phy_mode);
+
+ if (g_strcmp0(security, "psk_sha256") == 0) {
+ connman_network_set_psk_sha256(network, true);
+ security = "psk";
+ }
#endif
connman_network_set_string(network, "WiFi.Security", security);
connman_network_set_strength(network,
diff --git a/src/connman.h b/src/connman.h
index e63eb9d5..d3cd96cf 100755
--- a/src/connman.h
+++ b/src/connman.h
@@ -675,6 +675,11 @@ const char *__connman_network_get_group(struct connman_network *network);
const char *__connman_network_get_ident(struct connman_network *network);
bool __connman_network_get_weakness(struct connman_network *network);
+#if defined TIZEN_EXT
+bool connman_network_get_psk_sha256(struct connman_network *network);
+void connman_network_set_psk_sha256(struct connman_network *network, bool is_psk_sha256);
+#endif
+
int __connman_config_init();
void __connman_config_cleanup(void);
diff --git a/src/network.c b/src/network.c
index 69e6216c..47583a0c 100755
--- a/src/network.c
+++ b/src/network.c
@@ -150,6 +150,7 @@ struct connman_network {
#if defined TIZEN_EXT
/* Multiple APN services and a default APN which a user selected */
bool default_internet;
+ bool is_psk_sha256;
#endif
};
@@ -1795,6 +1796,9 @@ static void set_associate_error(struct connman_network *network)
service = connman_service_lookup_from_network(network);
#if defined TIZEN_EXT
+ if (!service)
+ return;
+
__connman_service_indicate_error(service,
CONNMAN_SERVICE_ERROR_AUTH_FAILED);
#else
@@ -1974,6 +1978,18 @@ bool connman_network_get_connected(struct connman_network *network)
return network->connected;
}
+#if defined TIZEN_EXT
+bool connman_network_get_psk_sha256(struct connman_network *network)
+{
+ return network->is_psk_sha256;
+}
+
+void connman_network_set_psk_sha256(struct connman_network *network, bool is_psk_sha256)
+{
+ network->is_psk_sha256 = is_psk_sha256;
+}
+#endif
+
/**
* connman_network_get_associating:
* @network: network structure