Skip to content

Commit

Permalink
Stop openconnect_set_proxy_auth() mangling its input.
Browse files Browse the repository at this point in the history
Even though it immediately frees it. We're going to change that...

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Oct 9, 2014
1 parent 8d7f511 commit f265eeb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions http.c
Expand Up @@ -2183,21 +2183,24 @@ int process_proxy(struct openconnect_info *vpninfo, int ssl_sock)

int openconnect_set_proxy_auth(struct openconnect_info *vpninfo, char *methods)
{
int i;
int i, len;
char *p, *start = methods;

for (i = 0; i < sizeof(auth_methods) / sizeof(auth_methods[0]); i++)
vpninfo->auth[auth_methods[i].state_index].state = AUTH_DISABLED;

while (methods) {
p = strchr(methods, ',');
if (p)
*(p++) = 0;
if (p) {
len = p - methods;
p++;
} else
len = strlen(methods);

for (i = 0; i < sizeof(auth_methods) / sizeof(auth_methods[0]); i++) {
if (!strcasecmp(methods, auth_methods[i].name) ||
if (strprefix_match(methods, len, auth_methods[i].name) ||
(auth_methods[i].state_index == AUTH_TYPE_GSSAPI &&
!strcasecmp(methods, "gssapi"))) {
strprefix_match(methods, len, "gssapi"))) {
vpninfo->auth[auth_methods[i].state_index].state = AUTH_UNSEEN;
break;
}
Expand Down

0 comments on commit f265eeb

Please sign in to comment.