Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Post CSD results even when no other auth is needed.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed Oct 8, 2018
1 parent f90a56d commit 81f1fce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion auth.c
Expand Up @@ -417,6 +417,12 @@ static int parse_auth_node(struct openconnect_info *vpninfo, xmlNode *xml_node,
} else if (!vpninfo->csd_scriptname && xmlnode_is_named(xml_node, "csd")) {
xmlnode_get_prop(xml_node, "token", &vpninfo->csd_token);
xmlnode_get_prop(xml_node, "ticket", &vpninfo->csd_ticket);
} else if (xmlnode_is_named(xml_node, "authentication-complete")) {
/* Ick. Since struct oc_auth_form is public there's no
* simple way to add a flag to it. So let's abuse the
* auth_id string instead. */
free(form->auth_id);
form->auth_id = strdup("openconnect_authentication_complete");
}
/* For Windows, vpninfo->csd_xmltag will be "csd" and there are *two* <csd>
nodes; one with token/ticket and one with the URLs. Process them both
Expand Down Expand Up @@ -648,6 +654,8 @@ static int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_for
vpn_progress(vpninfo, PRG_INFO, "%s\n", form->message);
if (form->error)
vpn_progress(vpninfo, PRG_ERR, "%s\n", form->error);
if (!strcmp(form->auth_id, "openconnect_authentication_complete"))
goto justpost;
return -EPERM;
}

Expand All @@ -662,7 +670,7 @@ static int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_for
vpninfo->token_bypassed = 1;
return ret;
}

justpost:
ret = vpninfo->xmlpost ?
xmlpost_append_form_opts(vpninfo, form, request_body) :
append_form_opts(vpninfo, form, request_body);
Expand Down

0 comments on commit 81f1fce

Please sign in to comment.