]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
detect user[name], pass[word] form fields using only the first 4 characters
authorDaniel Lenski <dlenski@gmail.com>
Tue, 15 Aug 2017 04:32:02 +0000 (21:32 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Tue, 27 Feb 2018 15:25:03 +0000 (16:25 +0100)
The current process_auth_form_cb hard-codes the interpretation of these form
fields based on their names.  GlobalProtect has identical fields but with
slightly different names.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
main.c

diff --git a/main.c b/main.c
index d09efd5150a561f31615d36b932278ad2bb4efb5..086df2b1726f6a3decd0bbb4a2b7d1b0eb744937 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1976,7 +1976,7 @@ static int process_auth_form_cb(void *_vpninfo,
 
                } else if (opt->type == OC_FORM_OPT_TEXT) {
                        if (username &&
-                           !strcmp(opt->name, "username")) {
+                           !strncmp(opt->name, "user", 4)) {
                                opt->_value = username;
                                username = NULL;
                        } else {
@@ -1989,7 +1989,7 @@ static int process_auth_form_cb(void *_vpninfo,
 
                } else if (opt->type == OC_FORM_OPT_PASSWORD) {
                        if (password &&
-                           !strcmp(opt->name, "password")) {
+                           !strncmp(opt->name, "pass", 4)) {
                                opt->_value = password;
                                password = NULL;
                        } else {