We were missing it for Juniper. Rather than adding a third copy of the
same code, put it in the generic caller.
Reported-by: Andy Wang <dopey@moonteeth.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
const char *request_body_type = "application/x-www-form-urlencoded";
char *xml_buf = NULL, *orig_path;
-#ifdef HAVE_LIBSTOKEN
- /* Step 1: Unlock software token (if applicable) */
- if (vpninfo->token_mode == OC_TOKEN_MODE_STOKEN) {
- result = prepare_stoken(vpninfo);
- if (result)
- goto out;
- }
-#endif
-
/* Ask the user to fill in the auth form; repeat as necessary */
for (;;) {
/* submit prelogin request to get form */
int cert_rq, cert_sent = !vpninfo->cert;
int newgroup_attempts = 5;
-#ifdef HAVE_LIBSTOKEN
- /* Step 1: Unlock software token (if applicable) */
- if (vpninfo->token_mode == OC_TOKEN_MODE_STOKEN) {
- result = prepare_stoken(vpninfo);
- if (result)
- goto out;
- }
-#endif
-
if (!vpninfo->xmlpost)
goto no_xmlpost;
int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
{
+#ifdef HAVE_LIBSTOKEN
+ int ret;
+ if (vpninfo->token_mode == OC_TOKEN_MODE_STOKEN) {
+ ret = prepare_stoken(vpninfo);
+ if (ret)
+ return ret;
+ }
+#endif
return vpninfo->proto->obtain_cookie(vpninfo);
}