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;
}
strcmp(form->auth_id, "frmTotpToken"))
return -EINVAL;
+ okay:
return can_gen_tokencode(vpninfo, form, opt);
}
<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>