From: Klas Lindfors Date: Thu, 9 Jan 2014 08:52:13 +0000 (+0100) Subject: use ykp_get_supported_key_length() X-Git-Tag: v1.15.0~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f9fee85bb0ef55888d072d7a5b1b6d5fc3ac7bd;p=yubikey-personalization use ykp_get_supported_key_length() --- diff --git a/ykpers-args.c b/ykpers-args.c index 5d3f910..7c9f1ce 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -713,18 +713,9 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, } if (*keylocation == 1) { - bool long_key_valid = false; + bool long_key_valid = ykp_get_supported_key_length(cfg) == 20 ? true : false; int res = 0; - /* for OATH-HOTP, 160 bits key is also valid */ - if (ykp_get_tktflag_OATH_HOTP(cfg)) - long_key_valid = true; - - /* for HMAC (not Yubico) challenge-response, 160 bits key is also valid */ - if(ykp_get_tktflag_CHAL_RESP(cfg) && ykp_get_cfgflag_CHAL_HMAC(cfg)) { - long_key_valid = true; - } - if (long_key_valid && strlen(aeshash) == 40) { res = ykp_HMAC_key_from_hex(cfg, aeshash); } else {