Skip to content

Commit

Permalink
Use generic can_gen_tokencode() for oNCP
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 30, 2015
1 parent ca56129 commit 3e097d5
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions oncp.c
Expand Up @@ -73,25 +73,12 @@ static int oncp_can_gen_tokencode(struct openconnect_info *vpninfo,
if (vpninfo->token_mode == OC_TOKEN_MODE_NONE ||
vpninfo->token_bypassed)
return -EINVAL;

if (strcmp(form->auth_id, "frmDefender") &&
strcmp(form->auth_id, "frmNextToken"))
return -EINVAL;

switch (vpninfo->token_mode) {
#ifdef HAVE_LIBOATH
case OC_TOKEN_MODE_TOTP:
return can_gen_totp_code(vpninfo, form, opt);

case OC_TOKEN_MODE_HOTP:
return can_gen_hotp_code(vpninfo, form, opt);
#endif
#ifdef HAVE_LIBPCSCLITE
case OC_TOKEN_MODE_YUBIOATH:
return can_gen_yubikey_code(vpninfo, form, opt);
#endif
default:
return -EINVAL;
}
return can_gen_tokencode(vpninfo, form, opt);
}


Expand Down

0 comments on commit 3e097d5

Please sign in to comment.