We are supposed to take the *last* (unescaped) @ sign as the separation
between user:pass and hostname, not the first. So use strrchr() instead
of strchr().
Conversely, the first colon is the separation between user and pass so
strchr is still correct there.
Also actually support unescaping the resulting username and password.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
#include <stdio.h>
#include <stdarg.h>
+#include <libxml/uri.h>
+
#include "openconnect-internal.h"
static int proxy_write(struct openconnect_info *vpninfo, char *buf, size_t len);
if (ret)
goto out;
- p = strchr(vpninfo->proxy, '@');
+ p = strrchr(vpninfo->proxy, '@');
if (p) {
/* Proxy username/password */
*p = 0;
if (p) {
*p = 0;
vpninfo->proxy_pass = strdup(p + 1);
+ xmlURIUnescapeString(vpninfo->proxy_pass, 0, vpninfo->proxy_pass);
}
+ xmlURIUnescapeString(vpninfo->proxy_user, 0, vpninfo->proxy_user);
}
if (vpninfo->proxy_type &&
<li>Add HMAC-SHA256-128 (RFC4868) support for ESP.</li>
<li>Support IPv6 in ESP.</li>
<li>Translate user-visible strings from <tt>openconnect_get_supported_protocols()</tt>.</li>
+ <li>Fix proxy username/password handling to allow special characters and escaping.</li>
</ul><br/>
</li>
<li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-8.03.tar.gz">OpenConnect v8.03</a></b>