#if defined TIZEN_EXT
#define G_SUPPLICANT_KEYMGMT_SAE (1 << 10)
#define G_SUPPLICANT_KEYMGMT_OWE (1 << 22)
+#define G_SUPPLICANT_KEYMGMT_DPP (1 << 23)
#endif
#define G_SUPPLICANT_PROTO_WPA (1 << 0)
G_SUPPLICANT_SECURITY_FT_IEEE8021X,
G_SUPPLICANT_SECURITY_SAE,
G_SUPPLICANT_SECURITY_OWE,
+ G_SUPPLICANT_SECURITY_DPP,
#endif
} GSupplicantSecurity;
const char *phase1;
const char *pac_file;
uint16_t ieee80211w;
+ const char *connector;
+ const char *c_sign_key;
+ const char *net_access_key;
#endif
};
#if defined TIZEN_EXT
{ "sae", G_SUPPLICANT_KEYMGMT_SAE },
{ "owe", G_SUPPLICANT_KEYMGMT_OWE },
+ { "dpp", G_SUPPLICANT_KEYMGMT_DPP },
#endif
{ }
};
GSupplicantSecurity security;
char * passphrase;
char * private_passphrase;
+#if defined TIZEN_EXT
+ char *connector;
+ char *c_sign_key;
+ char *net_access_key;
+#endif
};
#if defined TIZEN_EXT_WIFI_MESH
#if defined TIZEN_EXT
dbus_bool_t sae;
dbus_bool_t owe;
+ dbus_bool_t dpp;
#endif
};
return "sae";
case G_SUPPLICANT_SECURITY_OWE:
return "owe";
+ case G_SUPPLICANT_SECURITY_DPP:
+ return "dpp";
#endif
}
return FALSE;
}
+#if defined TIZEN_EXT
+ if (interface->network_info.connector &&
+ g_strcmp0(interface->network_info.connector,
+ ssid->connector) != 0) {
+ return FALSE;
+ }
+ if (interface->network_info.c_sign_key &&
+ g_strcmp0(interface->network_info.c_sign_key,
+ ssid->c_sign_key) != 0) {
+ return FALSE;
+ }
+ if (interface->network_info.net_access_key &&
+ g_strcmp0(interface->network_info.net_access_key,
+ ssid->net_access_key) != 0) {
+ return FALSE;
+ }
+#endif
return TRUE;
}
g_free(interface->network_info.ssid);
g_free(interface->network_info.passphrase);
g_free(interface->network_info.private_passphrase);
+#if defined TIZEN_EXT
+ g_free(interface->network_info.connector);
+ g_free(interface->network_info.c_sign_key);
+ g_free(interface->network_info.net_access_key);
+#endif
interface->network_info.ssid = NULL;
interface->network_info.passphrase = NULL;
interface->network_info.private_passphrase = NULL;
+#if defined TIZEN_EXT
+ interface->network_info.connector = NULL;
+ interface->network_info.c_sign_key = NULL;
+ interface->network_info.net_access_key = NULL;
+#endif
}
static int store_network_information(GSupplicantInterface * interface,
#if defined TIZEN_EXT
network->best_bss->security == G_SUPPLICANT_SECURITY_SAE ||
network->best_bss->security == G_SUPPLICANT_SECURITY_OWE ||
+ network->best_bss->security == G_SUPPLICANT_SECURITY_DPP ||
#endif /* TIZEN_EXT */
network->best_bss->security == G_SUPPLICANT_SECURITY_IEEE8021X) {
unsigned int pairwise;
#if defined TIZEN_EXT
if (network->best_bss->security == G_SUPPLICANT_SECURITY_SAE ||
- network->best_bss->security == G_SUPPLICANT_SECURITY_OWE)
+ network->best_bss->security == G_SUPPLICANT_SECURITY_OWE ||
+ network->best_bss->security == G_SUPPLICANT_SECURITY_DPP)
return false;
#endif /* TIZEN_EXT */
bss->sae = TRUE;
if (bss->keymgmt & G_SUPPLICANT_KEYMGMT_OWE)
bss->owe = TRUE;
+ if (bss->keymgmt & G_SUPPLICANT_KEYMGMT_DPP)
+ bss->dpp = TRUE;
#endif
if (bss->ieee8021x)
bss->security = G_SUPPLICANT_SECURITY_SAE;
else if (bss->owe)
bss->security = G_SUPPLICANT_SECURITY_OWE;
+ else if (bss->dpp)
+ bss->security = G_SUPPLICANT_SECURITY_DPP;
#endif
else if (bss->privacy)
bss->security = G_SUPPLICANT_SECURITY_WEP;
#if defined TIZEN_EXT
g_free(data->ssid->ssid);
g_free((char *)data->ssid->passphrase);
+ g_free((char *)data->ssid->connector);
+ g_free((char *)data->ssid->c_sign_key);
+ g_free((char *)data->ssid->net_access_key);
#endif
g_free(data->ssid);
dbus_free(data);
#if defined TIZEN_EXT
g_free(data->ssid->ssid);
g_free((char *)data->ssid->passphrase);
+ g_free((char *)data->ssid->connector);
+ g_free((char *)data->ssid->c_sign_key);
+ g_free((char *)data->ssid->net_access_key);
#endif
g_free(data->ssid);
g_free(data);
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_OWE
+ && ssid->security != G_SUPPLICANT_SECURITY_DPP)
return;
supplicant_dbus_dict_append_basic(dict, "ieee80211w", DBUS_TYPE_UINT32,
&ssid->ieee80211w);
}
+
+static void add_network_security_connector(DBusMessageIter *dict, GSupplicantSSID *ssid)
+{
+ if (ssid->connector && strlen(ssid->connector) > 0) {
+ const char *key = "dpp_connector";
+
+ supplicant_dbus_dict_append_basic(dict,
+ key, DBUS_TYPE_STRING,
+ &ssid->connector);
+ }
+}
+
+static size_t convert_hexstr_to_bin(const char *hex_str, unsigned char **bin)
+{
+ unsigned char *bin_res = NULL;
+ unsigned int i, j, hex;
+ size_t hex_str_len;
+
+ if (!hex_str || strlen(hex_str) == 0)
+ return 0;
+
+ hex_str_len = strlen(hex_str);
+ bin_res = g_try_malloc0(hex_str_len / 2);
+ if (!bin_res)
+ return 0;
+
+ j = 0;
+ for (i = 0; i < hex_str_len; i+=2) {
+ sscanf(hex_str + i, "%02x", &hex);
+ bin_res[j++] = hex;
+ }
+
+ *bin = bin_res;
+ return hex_str_len / 2;
+}
+
+static void add_network_security_c_sign_key(DBusMessageIter *dict, GSupplicantSSID *ssid)
+{
+ if (ssid->c_sign_key && strlen(ssid->c_sign_key) > 0) {
+ const char *key = "dpp_csign";
+ unsigned char *bin_csign = NULL;
+ size_t bin_csign_len = convert_hexstr_to_bin(ssid->c_sign_key, &bin_csign);
+ if (bin_csign_len != 0)
+ supplicant_dbus_dict_append_fixed_array(dict,
+ key, DBUS_TYPE_BYTE,
+ &bin_csign, bin_csign_len);
+ g_free(bin_csign);
+ }
+}
+
+static void add_network_security_net_access_key(DBusMessageIter *dict, GSupplicantSSID *ssid)
+{
+ if (ssid->net_access_key && strlen(ssid->net_access_key) > 0) {
+ const char *key = "dpp_netaccesskey";
+ unsigned char *bin_netaccesskey = NULL;
+ size_t bin_netaccesskey_len = convert_hexstr_to_bin(ssid->net_access_key, &bin_netaccesskey);
+ if (bin_netaccesskey_len != 0)
+ supplicant_dbus_dict_append_fixed_array(dict,
+ key, DBUS_TYPE_BYTE,
+ &bin_netaccesskey, bin_netaccesskey_len);
+ g_free(bin_netaccesskey);
+ }
+}
+
#endif
static void add_network_security(DBusMessageIter *dict, GSupplicantSSID *ssid)
add_network_security_ciphers(dict, ssid);
add_network_security_proto(dict, ssid);
break;
+ case G_SUPPLICANT_SECURITY_DPP:
+ key_mgmt = "DPP";
+ add_network_security_connector(dict, ssid);
+ add_network_security_c_sign_key(dict, ssid);
+ add_network_security_net_access_key(dict, ssid);
+ break;
#endif
}
g_free(data->path);
g_free(data->ssid->ssid);
g_free((char *)data->ssid->passphrase);
+ g_free((char *)data->ssid->connector);
+ g_free((char *)data->ssid->c_sign_key);
+ g_free((char *)data->ssid->net_access_key);
g_free(data->ssid);
dbus_free(data);
}
return 0;
}
+
+static void decrypt_conf_obj_reply(DBusPendingCall *call,
+ void *user_data)
+{
+ DBusMessage *reply;
+ DBusError error;
+ DBusMessageIter iter, dict;
+ char *out_data;
+ int ret;
+ struct interface_connect_data *data = user_data;
+
+ reply = dbus_pending_call_steal_reply(call);
+
+ dbus_error_init(&error);
+ if (dbus_set_error_from_message(&error, reply)) {
+ SUPPLICANT_DBG("decryption_conf_obj_reply() %s %s", error.name, error.message);
+ dbus_error_free(&error);
+ ret = -EINVAL;
+ goto done;
+ }
+
+ if (dbus_message_iter_init(reply, &iter) == FALSE) {
+ SUPPLICANT_DBG("dbus_message_iter_init() failed");
+ ret = -EINVAL;
+ goto done;
+ }
+
+ dbus_message_iter_recurse(&iter, &dict);
+
+ while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) {
+ DBusMessageIter entry, value;
+ const char *key;
+
+ dbus_message_iter_recurse(&dict, &entry);
+ dbus_message_iter_get_basic(&entry, &key);
+ dbus_message_iter_next(&entry);
+ dbus_message_iter_recurse(&entry, &value);
+ if (dbus_message_iter_get_arg_type(&value) == DBUS_TYPE_STRING) {
+ if (g_strcmp0(key, "connector") == 0) {
+ dbus_message_iter_get_basic(&value, &out_data);
+ data->ssid->connector = g_strdup((const gchar *)out_data);
+ SUPPLICANT_DBG("connector %s", data->ssid->connector);
+ } else if (g_strcmp0(key, "c_sign_key") == 0) {
+ dbus_message_iter_get_basic(&value, &out_data);
+ data->ssid->c_sign_key = g_strdup((const gchar *)out_data);
+ SUPPLICANT_DBG("c_sign_key %s", data->ssid->c_sign_key);
+ } else if (g_strcmp0(key, "net_access_key") == 0) {
+ dbus_message_iter_get_basic(&value, &out_data);
+ data->ssid->net_access_key = g_strdup((const gchar *)out_data);
+ SUPPLICANT_DBG("net_access_key %s", data->ssid->net_access_key);
+ }
+ }
+ dbus_message_iter_next(&dict);
+ }
+
+ ret = supplicant_dbus_method_call(data->interface->path,
+ SUPPLICANT_INTERFACE ".Interface", "AddNetwork",
+ interface_add_network_params,
+ interface_add_network_result, data,
+ data->interface);
+
+done:
+ if (ret < 0) {
+ SUPPLICANT_DBG("AddNetwork failed %d", ret);
+ callback_assoc_failed(decrypt_request_data.data->user_data);
+ g_free(data->path);
+ g_free(data->ssid->ssid);
+ g_free((char *)data->ssid->connector);
+ g_free((char *)data->ssid->c_sign_key);
+ g_free((char *)data->ssid->net_access_key);
+ g_free(data->ssid);
+ dbus_free(data);
+ }
+
+ dbus_message_unref(reply);
+ dbus_pending_call_unref(call);
+
+ decrypt_request_data.pending_call = NULL;
+ decrypt_request_data.data = NULL;
+}
+
+static int send_decryption_conf_obj_request(GSupplicantSSID *ssid,
+ struct interface_connect_data *data)
+{
+ DBusMessage *msg = NULL;
+ DBusPendingCall *call;
+
+ SUPPLICANT_DBG("Decryption configuration object request");
+
+ if (!ssid) {
+ SUPPLICANT_DBG("Invalid parameter");
+ return -EINVAL;
+ }
+
+ if (!connection)
+ return -EINVAL;
+
+ msg = dbus_message_new_method_call(NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
+ NETCONFIG_WIFI_INTERFACE, "DecryptConfObj");
+ if (!msg)
+ return -EINVAL;
+
+ dbus_message_append_args(msg, DBUS_TYPE_STRING, &ssid->connector,
+ DBUS_TYPE_INVALID);
+ dbus_message_append_args(msg, DBUS_TYPE_STRING, &ssid->c_sign_key,
+ DBUS_TYPE_INVALID);
+ dbus_message_append_args(msg, DBUS_TYPE_STRING, &ssid->net_access_key,
+ DBUS_TYPE_INVALID);
+
+ if (!dbus_connection_send_with_reply(connection, msg,
+ &call, DBUS_TIMEOUT_USE_DEFAULT)) {
+ dbus_message_unref(msg);
+ return -EIO;
+ }
+
+ if (!call) {
+ dbus_message_unref(msg);
+ return -EIO;
+ }
+
+ decrypt_request_data.pending_call = call;
+ decrypt_request_data.data = data;
+
+ dbus_pending_call_set_notify(call, decrypt_conf_obj_reply, data, NULL);
+ dbus_message_unref(msg);
+
+ SUPPLICANT_DBG("Decrypt Conf Obj request succeeded");
+
+ return 0;
+}
+
+static bool is_valid_config_object(GSupplicantSSID *ssid)
+{
+ return ((ssid->connector &&
+ g_strcmp0(ssid->connector, "") != 0) &&
+ (ssid->c_sign_key &&
+ g_strcmp0(ssid->c_sign_key, "") != 0) &&
+ (ssid->net_access_key &&
+ g_strcmp0(ssid->net_access_key, "") != 0));
+}
#endif
int g_supplicant_interface_connect(GSupplicantInterface *interface,
ret = send_decryption_request(ssid->passphrase, data);
if (ret < 0)
SUPPLICANT_DBG("Decryption request failed %d", ret);
+ } else if (is_valid_config_object(ssid)) {
+ ret = send_decryption_conf_obj_request(ssid, data);
+ if (ret < 0)
+ SUPPLICANT_DBG("Decryption Conf Obj request failed %d", ret);
+
} else
#endif
ret = supplicant_dbus_method_call(interface->path,
g_free(connect_data->path);
dbus_free(connect_data);
}
+ } else if (is_valid_config_object(data->ssid)) {
+ ret = send_decryption_conf_obj_request(data->ssid, connect_data);
+ if (ret < 0) {
+ SUPPLICANT_DBG("Decryption Conf Obj request failed %d", ret);
+ g_free(connect_data->ssid);
+ g_free(connect_data->path);
+ dbus_free(connect_data);
+ }
} else
#endif
supplicant_dbus_method_call(data->interface->path,
#if defined TIZEN_EXT
CONNMAN_SERVICE_SECURITY_SAE = 10,
CONNMAN_SERVICE_SECURITY_OWE = 11,
+ CONNMAN_SERVICE_SECURITY_DPP = 12,
#endif
};
return G_SUPPLICANT_SECURITY_SAE;
else if (g_str_equal(security, "owe"))
return G_SUPPLICANT_SECURITY_OWE;
+ else if (g_str_equal(security, "dpp"))
+ return G_SUPPLICANT_SECURITY_DPP;
#endif
return G_SUPPLICANT_SECURITY_UNKNOWN;
ssid->use_wps = connman_network_get_bool(network, "WiFi.UseWPS");
ssid->pin_wps = connman_network_get_string(network, "WiFi.PinWPS");
+#if defined TIZEN_EXT
+ ssid->connector = connman_network_get_string(network,
+ "WiFi.Connector");
+ ssid->c_sign_key = connman_network_get_string(network,
+ "WiFi.CSignKey");
+ ssid->net_access_key = connman_network_get_string(network,
+ "WiFi.NetAccessKey");
+#endif
#if defined TIZEN_EXT
if (set_connman_bssid(CHECK_BSSID, NULL) == 6) {
char **search_domains;
char **timeservers;
char *domain_name;
+#if defined TIZEN_EXT
+ char *connector;
+ char *c_sign_key;
+ char *net_access_key;
+#endif
};
struct connman_config {
#define SERVICE_KEY_SEARCH_DOMAINS "SearchDomains"
#define SERVICE_KEY_TIMESERVERS "Timeservers"
#define SERVICE_KEY_DOMAIN "Domain"
+#if defined TIZEN_EXT
+#define SERVICE_KEY_CONNECTOR "Connector"
+#define SERVICE_KEY_C_SIGN_KEY "CSignKey"
+#define SERVICE_KEY_NET_ACCESS_KEY "NetAccessKey"
+#endif
static const char *config_possible_keys[] = {
CONFIG_KEY_NAME,
SERVICE_KEY_SEARCH_DOMAINS,
SERVICE_KEY_TIMESERVERS,
SERVICE_KEY_DOMAIN,
+#if defined TIZEN_EXT
+ SERVICE_KEY_CONNECTOR,
+ SERVICE_KEY_C_SIGN_KEY,
+ SERVICE_KEY_NET_ACCESS_KEY,
+#endif
NULL,
};
g_free(config_service->config_ident);
g_free(config_service->config_entry);
g_free(config_service->virtual_file);
+#if defined TIZEN_EXT
+ g_free(config_service->connector);
+ g_free(config_service->c_sign_key);
+ g_free(config_service->net_access_key);
+#endif
g_free(config_service);
}
g_free(service->passphrase);
service->passphrase = str;
}
+#if defined TIZEN_EXT
+
+ str = __connman_config_get_string(keyfile, group, SERVICE_KEY_CONNECTOR,
+ NULL);
+ if (str) {
+ g_free(service->connector);
+ service->connector = str;
+ }
+
+ str = __connman_config_get_string(keyfile, group, SERVICE_KEY_C_SIGN_KEY,
+ NULL);
+ if (str) {
+ g_free(service->c_sign_key);
+ service->c_sign_key = str;
+ }
+
+ str = __connman_config_get_string(keyfile, group, SERVICE_KEY_NET_ACCESS_KEY,
+ NULL);
+ if (str) {
+ g_free(service->net_access_key);
+ service->net_access_key = str;
+ }
+#endif
str = __connman_config_get_string(keyfile, group, SERVICE_KEY_SECURITY,
NULL);
} else
service->security = CONNMAN_SERVICE_SECURITY_PSK;
+#if defined TIZEN_EXT
+ } else if (service->connector) {
+
+ if (str && security != CONNMAN_SERVICE_SECURITY_DPP)
+ connman_info("Mismatch between DPP configuration and "
+ "setting %s = %s",
+ SERVICE_KEY_SECURITY, str);
+
+ service->security = CONNMAN_SERVICE_SECURITY_DPP;
+#endif
} else if (str) {
if (security != CONNMAN_SERVICE_SECURITY_NONE)
if (config->hidden)
__connman_service_set_hidden(service);
+
+#if defined TIZEN_EXT
+ if (config->connector)
+ __connman_service_set_string(service, "Connector",
+ config->connector);
+ if (config->c_sign_key)
+ __connman_service_set_string(service, "CSignKey",
+ config->c_sign_key);
+ if (config->net_access_key)
+ __connman_service_set_string(service, "NetAccessKey",
+ config->net_access_key);
+#endif
}
struct connect_virtual {
GSList *bssid_list;
ieee80211_modes_e phy_mode;
connection_mode_e connection_mode;
+ char *connector;
+ char *c_sign_key;
+ char *net_access_key;
#endif
} wifi;
} else if (g_str_equal(key, "WiFi.PinWPS")) {
g_free(network->wifi.pin_wps);
network->wifi.pin_wps = g_strdup(value);
+#if defined TIZEN_EXT
+ } else if (g_str_equal(key, "WiFi.Connector")) {
+ g_free(network->wifi.connector);
+ network->wifi.connector = g_strdup(value);
+ } else if (g_str_equal(key, "WiFi.CSignKey")) {
+ g_free(network->wifi.c_sign_key);
+ network->wifi.c_sign_key = g_strdup(value);
+ } else if (g_str_equal(key, "WiFi.NetAccessKey")) {
+ g_free(network->wifi.net_access_key);
+ network->wifi.net_access_key = g_strdup(value);
+#endif
} else {
return -EINVAL;
}
return network->wifi.phase2_auth;
else if (g_str_equal(key, "WiFi.PinWPS"))
return network->wifi.pin_wps;
+#if defined TIZEN_EXT
+ else if (g_str_equal(key, "WiFi.Connector"))
+ return network->wifi.connector;
+ else if (g_str_equal(key, "WiFi.CSignKey"))
+ return network->wifi.c_sign_key;
+ else if (g_str_equal(key, "WiFi.NetAccessKey"))
+ return network->wifi.net_access_key;
+#endif
return NULL;
}
enum connman_dnsconfig_method dns_config_method_ipv4;
enum connman_dnsconfig_method dns_config_method_ipv6;
#endif
+#if defined TIZEN_EXT
+ char *connector;
+ char *c_sign_key;
+ char *net_access_key;
+#endif
};
static bool allow_property_changed(struct connman_service *service);
return CONNMAN_SERVICE_SECURITY_SAE;
if (!strcmp(str, "owe"))
return CONNMAN_SERVICE_SECURITY_OWE;
+ if (!strcmp(str, "dpp"))
+ return CONNMAN_SERVICE_SECURITY_DPP;
#endif
return CONNMAN_SERVICE_SECURITY_UNKNOWN;
return "sae";
case CONNMAN_SERVICE_SECURITY_OWE:
return "owe";
+ case CONNMAN_SERVICE_SECURITY_DPP:
+ return "dpp";
#else
case CONNMAN_SERVICE_SECURITY_RSN:
return "psk";
}
}
#endif
+#if defined TIZEN_EXT
+ if (service->type == CONNMAN_SERVICE_TYPE_WIFI &&
+ service->security == CONNMAN_SERVICE_SECURITY_DPP) {
+ str = g_key_file_get_string(keyfile,
+ service->identifier, "Connector", NULL);
+ if (str != NULL) {
+ g_free(service->connector);
+ service->connector = str;
+ }
+ str = g_key_file_get_string(keyfile,
+ service->identifier, "CSignKey", NULL);
+ if (str != NULL) {
+ g_free(service->c_sign_key);
+ service->c_sign_key = str;
+ }
+ str = g_key_file_get_string(keyfile,
+ service->identifier, "NetAccessKey", NULL);
+ if (str != NULL) {
+ g_free(service->net_access_key);
+ service->net_access_key = str;
+ }
+ }
+#endif
done:
g_key_file_free(keyfile);
g_key_file_remove_key(keyfile, service->identifier,
"PrivateKeyPassphrase", NULL);
}
+ if (service->type == CONNMAN_SERVICE_TYPE_WIFI &&
+ service->security == CONNMAN_SERVICE_SECURITY_DPP) {
+ if (service->connector != NULL && strlen(service->connector) > 0)
+ g_key_file_set_string(keyfile, service->identifier,
+ "Connector", service->connector);
+ else
+ g_key_file_remove_key(keyfile, service->identifier,
+ "Connector", NULL);
+
+ if (service->c_sign_key != NULL && strlen(service->c_sign_key) > 0)
+ g_key_file_set_string(keyfile, service->identifier,
+ "CSignKey", service->c_sign_key);
+ else
+ g_key_file_remove_key(keyfile, service->identifier,
+ "CSignKey", NULL);
+
+ if (service->net_access_key != NULL && strlen(service->net_access_key) > 0)
+ g_key_file_set_string(keyfile, service->identifier,
+ "NetAccessKey", service->net_access_key);
+ else
+ g_key_file_remove_key(keyfile, service->identifier,
+ "NetAccessKey", NULL);
+ }
#endif
done:
case CONNMAN_SERVICE_SECURITY_8021X:
#if defined TIZEN_EXT
case CONNMAN_SERVICE_SECURITY_OWE:
+ case CONNMAN_SERVICE_SECURITY_DPP:
#endif
break;
}
return -EINVAL;
#if defined TIZEN_EXT
+ if (service->immutable &&
+ service->security != CONNMAN_SERVICE_SECURITY_DPP)
+ return -EINVAL;
/* The encrypted passphrase is used here
* and validation is done by net-config before being encrypted.
*/
connman_network_set_string(service->network, "WiFi.Phase2", NULL);
connman_network_set_string(service->network, "WiFi.AnonymousIdentity", NULL);
}
+static void __connman_service_cleanup_network_dpp(struct connman_service *service)
+{
+ if (service == NULL)
+ return;
+
+ DBG("service %p ", service);
+
+ connman_network_set_string(service->network, "WiFi.Connector", NULL);
+ connman_network_set_string(service->network, "WiFi.CSignKey", NULL);
+ connman_network_set_string(service->network, "WiFi.NetAccessKey", NULL);
+}
#endif
bool __connman_service_remove(struct connman_service *service)
g_strfreev(service->nameservers_config);
service->nameservers_config = NULL;
+ g_free(service->connector);
+ service->connector = NULL;
+
+ g_free(service->c_sign_key);
+ service->c_sign_key = NULL;
+
+ g_free(service->net_access_key);
+ service->net_access_key = NULL;
+
+ __connman_service_cleanup_network_dpp(service);
#endif
service->error = CONNMAN_SERVICE_ERROR_UNKNOWN;
g_free(service->phase2);
g_free(service->config_file);
g_free(service->config_entry);
+#if defined TIZEN_EXT
+ g_free(service->connector);
+ g_free(service->c_sign_key);
+ g_free(service->net_access_key);
+#endif
if (service->stats.timer)
g_timer_destroy(service->stats.timer);
service->phase2 = g_strdup(value);
} else if (g_str_equal(key, "Passphrase"))
__connman_service_set_passphrase(service, value);
+#if defined TIZEN_EXT
+ else if (g_str_equal(key, "Connector")) {
+ g_free(service->connector);
+ service->connector = g_strdup(value);
+ } else if (g_str_equal(key, "CSignKey")) {
+ g_free(service->c_sign_key);
+ service->c_sign_key = g_strdup(value);
+ } else if (g_str_equal(key, "NetAccessKey")) {
+ g_free(service->net_access_key);
+ service->net_access_key = g_strdup(value);
+ } else
+ DBG("Unknown key: %s", key);
+#endif
}
void __connman_service_set_search_domains(struct connman_service *service,
service->phase1);
#endif
}
+#if defined TIZEN_EXT
+
+static bool has_valid_configuration_object(struct connman_service *service)
+{
+ return service->connector && service->c_sign_key && service->net_access_key;
+}
+
+static void prepare_dpp(struct connman_service *service)
+{
+ DBG("prepare dpp");
+ if (service->connector)
+ connman_network_set_string(service->network, "WiFi.Connector",
+ service->connector);
+
+ if (service->c_sign_key)
+ connman_network_set_string(service->network, "WiFi.CSignKey",
+ service->c_sign_key);
+
+ if (service->net_access_key)
+ connman_network_set_string(service->network, "WiFi.NetAccessKey",
+ service->net_access_key);
+}
+#endif
static int service_connect(struct connman_service *service)
{
}
break;
+#if defined TIZEN_EXT
+ case CONNMAN_SERVICE_SECURITY_DPP:
+ if (has_valid_configuration_object(service) &&
+ !service->network)
+ return -EINVAL;
+ break;
+#endif
case CONNMAN_SERVICE_SECURITY_8021X:
if (!service->eap) {
connman_warn("EAP type has not been found. "
#if defined TIZEN_EXT
case CONNMAN_SERVICE_SECURITY_SAE:
case CONNMAN_SERVICE_SECURITY_OWE:
+ break;
+ case CONNMAN_SERVICE_SECURITY_DPP:
+ prepare_dpp(service);
#endif
break;
case CONNMAN_SERVICE_SECURITY_8021X:
return CONNMAN_SERVICE_SECURITY_SAE;
else if (g_str_equal(security, "owe"))
return CONNMAN_SERVICE_SECURITY_OWE;
+ else if (g_str_equal(security, "dpp"))
+ return CONNMAN_SERVICE_SECURITY_DPP;
else if (g_str_equal(security, "ft_psk") == TRUE)
return CONNMAN_SERVICE_SECURITY_PSK;
else if (g_str_equal(security, "ft_ieee8021x") == TRUE)
if (service->phase2 != NULL)
connman_network_set_string(service->network, "WiFi.Phase2",
service->phase2);
+ if (service->eap != NULL)
+ connman_network_set_string(service->network, "WiFi.Connector",
+ service->connector);
+ if (service->identity != NULL)
+ connman_network_set_string(service->network, "WiFi.CSignKey",
+ service->c_sign_key);
+ if (service->phase2 != NULL)
+ connman_network_set_string(service->network, "WiFi.NetAccessKey",
+ service->net_access_key);
#endif
}