]> err.no Git - yubikey-personalization/commitdiff
fix logic of ykp_get_supported_key_length()
authorKlas Lindfors <klas@yubico.com>
Thu, 9 Jan 2014 07:51:01 +0000 (08:51 +0100)
committerKlas Lindfors <klas@yubico.com>
Thu, 9 Jan 2014 08:48:39 +0000 (09:48 +0100)
was reporting wrong size for yubico-challenge

ykpers.c

index cb1bbb8114c21d1e4d08731b38460e34fd8f439e..6e8fee52a3d645a6db86d1e190fb4c894d6fcc68 100644 (file)
--- 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;
        }