From: Jouni Malinen Date: Fri, 2 Jan 2015 10:25:32 +0000 (+0200) Subject: D-Bus: Make P2P Group Passphrase property getter available for P2P Client X-Git-Tag: hostap_2_4~587 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a4efde5bd399fad481e5741c628ba657d529a70;p=thirdparty%2Fhostap.git D-Bus: Make P2P Group Passphrase property getter available for P2P Client There is no need to limit this property based on the role of the device in the group, so return the passphrase if it is available. It will be available in GO role and it may be available in P2P Client role based on whether the peer GO provided it during the WPS provisioning step. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index 339ebdfbe..9c880a230 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -2045,15 +2045,14 @@ dbus_bool_t wpas_dbus_getter_p2p_group_passphrase(DBusMessageIter *iter, void *user_data) { struct wpa_supplicant *wpa_s = user_data; - u8 role = wpas_get_p2p_role(wpa_s); - char *p_pass = NULL; + char *p_pass; + struct wpa_ssid *ssid = wpa_s->current_ssid; - /* Verify correct role for this property */ - if (role == WPAS_P2P_ROLE_GO) { - if (wpa_s->current_ssid == NULL) - return FALSE; - p_pass = wpa_s->current_ssid->passphrase; - } else + if (ssid == NULL) + return FALSE; + + p_pass = ssid->passphrase; + if (!p_pass) p_pass = ""; return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING,