list = g_key_file_get_string_list(keyfile, GROUP_CONFIG,
"KnownNetworks", &list_len, NULL);
for (i = 0; i < list_len; i++) {
- DBG("known network %s", list[i]);
-
if (g_str_equal(list[i], network) == TRUE) {
- DBG("found network %s", network);
-
result = g_key_file_get_string(keyfile, network,
"PSK", NULL);
if (result == NULL)
struct connman_iface *iface = data;
DBusMessage *reply;
const char *network;
+ gchar *passphrase;
DBG("conn %p", conn);
dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &network,
DBUS_TYPE_INVALID);
+ passphrase = __connman_iface_find_passphrase(iface, network);
+ if (passphrase == NULL)
+ goto done;
+
g_free(iface->network.identifier);
iface->network.identifier = g_strdup(network);
+ g_free(iface->network.passphrase);
+ iface->network.passphrase = passphrase;
__connman_iface_connect(iface, &iface->network);
+done:
reply = dbus_message_new_method_return(msg);
if (reply == NULL)
return NULL;