Skip to content

Commit

Permalink
style nitpicks, expand clarifying comment, changelog
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
  • Loading branch information
dlenski committed Nov 4, 2020
1 parent 000f2f4 commit db101c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 9 additions & 7 deletions auth-juniper.c
Expand Up @@ -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;
}
Expand All @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions www/changelog.xml
Expand Up @@ -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>
Expand Down

0 comments on commit db101c8

Please sign in to comment.