Commit e8a0cecc authored by Kevin Cernekee's avatar Kevin Cernekee Committed by David Woodhouse

auth: Implement special handling of password fields on XML POST

The Cisco AnyConnect client exhibits some quirky behavior on fields
with certain names:

For "answer", "whichpin", and "new_password", the field is renamed to
"password" in the submission.

For "verify_pin" and "verify_password", the field is omitted entirely.
One might expect the client to perform a comparison to see if the first
password/PIN field matches the verify_* field, but in my testing, I didn't
actually see it doing so.
Signed-off-by: default avatarKevin Cernekee <cernekee@gmail.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 5c4d37a1
......@@ -803,6 +803,21 @@ static int xmlpost_append_form_opts(struct openconnect_info *vpninfo,
continue;
}
/* answer,whichpin,new_password: rename to "password" */
if (!strcmp(opt->name, "answer") ||
!strcmp(opt->name, "whichpin") ||
!strcmp(opt->name, "new_password")) {
if (!xmlNewTextChild(node, NULL, XCAST("password"), XCAST(opt->value)))
goto bad;
continue;
}
/* verify_pin,verify_password: ignore */
if (!strcmp(opt->name, "verify_pin") ||
!strcmp(opt->name, "verify_password")) {
continue;
}
/* everything else: create <foo>user_input</foo> under <auth> */
if (!xmlNewTextChild(node, NULL, XCAST(opt->name), XCAST(opt->value)))
goto bad;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment