From: Klas Lindfors Date: Thu, 9 Jan 2014 07:51:01 +0000 (+0100) Subject: fix logic of ykp_get_supported_key_length() X-Git-Tag: v1.15.0~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3c4c974cbd313f453bb7d151e461951df399ebe;p=yubikey-personalization fix logic of ykp_get_supported_key_length() was reporting wrong size for yubico-challenge --- diff --git a/ykpers.c b/ykpers.c index cb1bbb8..6e8fee5 100644 --- a/ykpers.c +++ b/ykpers.c @@ -236,11 +236,10 @@ int ykp_get_supported_key_length(const YKP_CONFIG *cfg) /* OATH-HOTP and HMAC-SHA1 challenge response support 20 byte (160 bits) * keys, holding the last four bytes in the uid field. */ - if ((cfg->ykcore_config.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP) - return 20; - - if ((cfg->ykcore_config.tktFlags & TKTFLAG_CHAL_RESP) == TKTFLAG_CHAL_RESP && - (cfg->ykcore_config.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) { + if((ykp_get_tktflag_OATH_HOTP(cfg) && + !ykp_get_cfgflag_CHAL_YUBICO(cfg)) || + (ykp_get_tktflag_CHAL_RESP(cfg) && + ykp_get_cfgflag_CHAL_HMAC(cfg))) { return 20; }