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 <j@w1.fi>
This commit is contained in:
parent
20e1d81e09
commit
1a4efde5bd
1 changed files with 7 additions and 8 deletions
|
@ -2045,15 +2045,14 @@ dbus_bool_t wpas_dbus_getter_p2p_group_passphrase(DBusMessageIter *iter,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
struct wpa_supplicant *wpa_s = user_data;
|
struct wpa_supplicant *wpa_s = user_data;
|
||||||
u8 role = wpas_get_p2p_role(wpa_s);
|
char *p_pass;
|
||||||
char *p_pass = NULL;
|
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||||
|
|
||||||
/* Verify correct role for this property */
|
if (ssid == NULL)
|
||||||
if (role == WPAS_P2P_ROLE_GO) {
|
|
||||||
if (wpa_s->current_ssid == NULL)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
p_pass = wpa_s->current_ssid->passphrase;
|
|
||||||
} else
|
p_pass = ssid->passphrase;
|
||||||
|
if (!p_pass)
|
||||||
p_pass = "";
|
p_pass = "";
|
||||||
|
|
||||||
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING,
|
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING,
|
||||||
|
|
Loading…
Reference in a new issue