]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
style nitpicks, expand clarifying comment, changelog
authorDaniel Lenski <dlenski@gmail.com>
Wed, 24 Jun 2020 23:01:18 +0000 (16:01 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Wed, 4 Nov 2020 21:36:28 +0000 (13:36 -0800)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
auth-juniper.c
www/changelog.xml

index 94986dfaefeb3b7f76eeb6bce287552323e5dcf6..492cef522e5764792f332a38ad1336e0fb9504bb 100644 (file)
@@ -75,13 +75,14 @@ static int oncp_can_gen_tokencode(struct openconnect_info *vpninfo,
                return -EINVAL;
 
        if (!strcmp(form->auth_id, "frmLogin")) {
-               // The first "password" input in frmLogin is likely to be a password, not 2FA token
-               struct oc_form_opt **p = &form->opts;
-               while (*p) {
-                       if ((*p)->type == OC_FORM_OPT_PASSWORD) {
-                               return can_gen_tokencode(vpninfo, form, opt);
-                       }
-                       p = &(*p)->next;
+               /* XX: The first occurence of a password input field in frmLogin is likely to be a password,
+                * not token, input. However, if we have already added a password input field to this form,
+                * then a second one is likely to hold a token.
+                */
+               struct oc_form_opt *p;
+               for (p = form->opts; p; p = p->next) {
+                       if (p->type == OC_FORM_OPT_PASSWORD)
+                               goto okay;
                }
                return -EINVAL;
        }
@@ -91,6 +92,7 @@ static int oncp_can_gen_tokencode(struct openconnect_info *vpninfo,
            strcmp(form->auth_id, "frmTotpToken"))
                return -EINVAL;
 
+ okay:
        return can_gen_tokencode(vpninfo, form, opt);
 }
 
index d1965832cb24b6feb2097edfbcc9d860cdd60a2e..28ac2c39fcc53fdb53c71451aad2b074a6a43ecb 100644 (file)
@@ -17,6 +17,7 @@
      <ul>
        <li>Make <tt>tncc-emulate.py</tt> work with Python 3.7+. (<a href="https://gitlab.com/openconnect/openconnect/-/issues/152">!152</a>, <a href="https://gitlab.com/openconnect/openconnect/merge_requests/120">!120</a>)</li>
        <li>Emulated a newer version of GlobalProtect official clients, 5.1.5-8; was 4.0.2-19 (<a href="https://gitlab.com/openconnect/openconnect/merge_requests/131">!131</a>)</li>
+       <li>Support Juniper login forms containing both password and 2FA token (<a href="https://gitlab.com/openconnect/openconnect/-/merge_requests/121">!121</a>)</li>
      </ul><br/>
   </li>
   <li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-8.10.tar.gz">OpenConnect v8.10</a></b>