@@ -6102,7 +6102,7 @@ def test_dbus_creds(dev, apdev):
(bus, wpas_obj, path, if_obj) = prepare_dbus(dev[0])
iface = dbus.Interface(if_obj, WPAS_DBUS_IFACE)
- args = {'domain': 'server.w1.fi',
+ args = {'domain': ['server.w1.fi','server2.w1.fi'],
'realm': 'server.w1.fi',
'roaming_consortium': '50a9bf',
'required_roaming_consortium': '23bf50',
@@ -412,6 +412,38 @@ static dbus_bool_t set_cred_properties(struct wpa_supplicant *wpa_s,
entry.int32_value);
if (os_snprintf_error(size, ret))
goto error;
+ } else if (entry.type == DBUS_TYPE_ARRAY &&
+ entry.array_type == DBUS_TYPE_STRING) {
+ if (entry.array_len <= 0)
+ goto error;
+
+ for (int i = 0; i < entry.array_len; i++) {
+ if (should_quote_opt(entry.key)) {
+ size = os_strlen(entry.strarray_value[i]);
+
+ size += 3;
+ value = os_zalloc(size);
+ if (!value)
+ goto error;
+
+ ret = os_snprintf(value, size, "\"%s\"",
+ entry.strarray_value[i]);
+ if (os_snprintf_error(size, ret))
+ goto error;
+ } else {
+ value = os_strdup(entry.strarray_value[i]);
+ if (!value)
+ goto error;
+ }
+
+ ret = wpa_config_set_cred(cred, entry.key, value, 0);
+ if (ret < 0)
+ goto error;
+ os_free(value);
+ value = NULL;
+ }
+ wpa_dbus_dict_entry_clear(&entry);
+ continue;
} else {
goto error;
}
Adds the support of multiple domains for interworking credentials in D-Bus API. Signed-off-by: Damien Dejean <damiendejean@chromium.org> --- tests/hwsim/test_dbus.py | 2 +- wpa_supplicant/dbus/dbus_new_handlers.c | 32 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-)