[PATCH 2/4] auth: Implement special handling of password fields on XML POST

Kevin Cernekee cernekee at gmail.com
Sat Feb 16 19:18:05 EST 2013


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: Kevin Cernekee <cernekee at gmail.com>
---
 auth.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/auth.c b/auth.c
index a4f95d6..59587f1 100644
--- a/auth.c
+++ b/auth.c
@@ -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;
-- 
1.7.10.4




More information about the openconnect-devel mailing list