Skip to content

Instantly share code, notes, and snippets.

@shanemhansen
Created January 21, 2016 21:52
Show Gist options
  • Save shanemhansen/036232ae2354d66f74ed to your computer and use it in GitHub Desktop.
Save shanemhansen/036232ae2354d66f74ed to your computer and use it in GitHub Desktop.
Fix to get libstoken integration working on my company's vpn

My issue was that the passwords were being sent in the wrong order. I needed to send my regular password first and my token 2nd.

I had to apply this diff to auth.c which made rsa token generation similar to whatever "LIBOAUTH" does.

-	if ((strcmp(opt->name, "password") && strcmp(opt->name, "answer")) ||
+	if ((strcmp(opt->name, "secondary_password") != 0) ||

this essentially mirrors the logic here:

static int can_gen_totp_code(struct openconnect_info *vpninfo,
                 struct oc_auth_form *form,
                 struct oc_form_opt *opt)
{
#ifdef HAVE_LIBOATH
    if ((strcmp(opt->name, "secondary_password") != 0) ||
        vpninfo->toke

I have no idea if this is the "correct" fix for other people or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment