if (ret == OC_FORM_RESULT_CANCELLED || ret < 0)
goto out;
+ /* generate token code if specified */
+ ret = do_gen_tokencode(vpninfo, form);
+ if (ret) {
+ vpn_progress(vpninfo, PRG_ERR, _("Failed to generate OTP tokencode; disabling token\n"));
+ vpninfo->token_bypassed = 1;
+ goto out;
+ }
+
buf_truncate(resp_buf);
append_form_opts(vpninfo, form, resp_buf);
buf_append(resp_buf, "&realm=%s", realm ?: ""); /* XX: already URL-escaped */
.name = "pulse",
.pretty_name = N_("Pulse Connect Secure"),
.description = N_("Compatible with Pulse Connect Secure SSL VPN"),
- .flags = OC_PROTO_PROXY,
+ .flags = OC_PROTO_PROXY | OC_PROTO_AUTH_CERT | OC_PROTO_AUTH_OTP | OC_PROTO_AUTH_STOKEN,
.vpn_close_session = pulse_bye,
.tcp_connect = pulse_connect,
.tcp_mainloop = pulse_mainloop,
.name = "f5",
.pretty_name = N_("F5 BIG-IP SSL VPN"),
.description = N_("Compatible with F5 BIG-IP SSL VPN"),
- .flags = OC_PROTO_PROXY,
+ .flags = OC_PROTO_PROXY | OC_PROTO_AUTH_CERT,
.vpn_close_session = f5_bye,
.tcp_connect = f5_connect,
.tcp_mainloop = ppp_mainloop,
.name = "fortinet",
.pretty_name = N_("Fortinet SSL VPN"),
.description = N_("Compatible with FortiGate SSL VPN"),
- .flags = OC_PROTO_PROXY,
+ .flags = OC_PROTO_PROXY | OC_PROTO_AUTH_CERT | OC_PROTO_AUTH_OTP | OC_PROTO_AUTH_STOKEN,
.vpn_close_session = fortinet_bye,
.tcp_connect = fortinet_connect,
.tcp_mainloop = ppp_mainloop,
def logincheck():
want_2fa = session.get('want_2fa')
- if (want_2fa and 'code' in request.form):
+ if (want_2fa and request.form.get('code')):
return complete_2fa()
- elif (want_2fa and 'credential' in request.form):
+ elif (want_2fa and request.form.get('username') and request.form.get('credential')):
return send_2fa_challenge()
- elif ('credential' in request.form):
+ elif (request.form.get('username') and request.form.get('credential')):
return complete_non_2fa()
abort(405)