Skip to content

Commit

Permalink
Fix handling of SHA512
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 4f23499 commit e1a2dad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oath.c
Expand Up @@ -240,7 +240,7 @@ int set_totp_mode(struct openconnect_info *vpninfo, const char *token_str)
} else if (!strncasecmp(token_str, "sha512:", 7)) {
token_str += 7;
toklen -= 7;
vpninfo->oath_hmac_alg = OATH_ALG_HMAC_SHA256;
vpninfo->oath_hmac_alg = OATH_ALG_HMAC_SHA512;
} else
vpninfo->oath_hmac_alg = OATH_ALG_HMAC_SHA1;

Expand Down Expand Up @@ -293,7 +293,7 @@ int set_hotp_mode(struct openconnect_info *vpninfo, const char *token_str)
} else if (!strncasecmp(token_str, "sha512:", 7)) {
toklen -= 7;
token_str += 7;
vpninfo->oath_hmac_alg = OATH_ALG_HMAC_SHA256;
vpninfo->oath_hmac_alg = OATH_ALG_HMAC_SHA512;
} else
vpninfo->oath_hmac_alg = OATH_ALG_HMAC_SHA1;

Expand Down

0 comments on commit e1a2dad

Please sign in to comment.