From 1a4efde5bd399fad481e5741c628ba657d529a70 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 2 Jan 2015 12:25:32 +0200 Subject: [PATCH] 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 --- wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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,