Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. [PATCH] pptp: Inform VPN agent about auth errors and unset pwd as hidden
value
(Jussi Laakkonen)
----------------------------------------------------------------------
Date: Wed, 27 Nov 2019 16:27:13 +0200
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH] pptp: Inform VPN agent about auth errors and unset
pwd as hidden value
To: [email protected]
Message-ID: <[email protected]>
Send "VpnAgent.AuthFailure" to VPN agent if there are authentication
errors to indicate that previous login has failed and new credentials
are required to be given. Authentication errors are detected by
plugins/vpn.c:vpn_died() via pptp.c:pptp_error_code() which causes the
error to be indicated accordingly.
If a password is unset with vpn_provider_set_string() a property change
signal will be sent (see vpn/vpn-provider.c:set_string()). This should
be avoided because a VPN agent listening for changes may interpret this
as changing the password into empty string.
This would be the case when authentication fails or when disconnecting.
At the next connection attempt the password retrieved via VPN agent
would be an empty string. Added empty string checks to make sure this
never happens and password is requested from VPN agent when it is also
an empty string.
---
vpn/plugins/pptp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/vpn/plugins/pptp.c b/vpn/plugins/pptp.c
index 8fae2fff..5fc861e4 100644
--- a/vpn/plugins/pptp.c
+++ b/vpn/plugins/pptp.c
@@ -137,7 +137,8 @@ static int pptp_notify(DBusMessage *msg, struct
vpn_provider *provider)
DBG("authentication failure");
vpn_provider_set_string(provider, "PPTP.User", NULL);
- vpn_provider_set_string(provider, "PPTP.Password", NULL);
+ vpn_provider_set_string_hide_value(provider, "PPTP.Password",
+ NULL);
return VPN_STATE_AUTH_FAILURE;
}
@@ -396,6 +397,9 @@ static int request_input(struct vpn_provider *provider,
connman_dbus_dict_open(&iter, &dict);
+ if (vpn_provider_get_authentication_errors(provider))
+ vpn_agent_append_auth_failure(&dict, provider, NULL);
+
vpn_agent_append_user_info(&dict, provider, "PPTP.User");
vpn_agent_append_host_and_name(&dict, provider);
@@ -603,7 +607,7 @@ static void pptp_disconnect(struct vpn_provider *provider)
if (!provider)
return;
- vpn_provider_set_string(provider, "PPTP.Password", NULL);
+ vpn_provider_set_string_hide_value(provider, "PPTP.Password", NULL);
connman_agent_cancel(provider);
}
--
2.20.1
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]
------------------------------
End of connman Digest, Vol 49, Issue 28
***************************************