From: Klas Lindfors Date: Wed, 25 Apr 2012 11:04:00 +0000 (+0200) Subject: add checks for neo to the capabilities that matter X-Git-Tag: v1.7.0~1^2~30 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=725e04195b06942213ce72619e0ea5c79f59a631;p=yubikey-personalization add checks for neo to the capabilities that matter --- diff --git a/ykpers.c b/ykpers.c index 8f48485..e67f960 100644 --- a/ykpers.c +++ b/ykpers.c @@ -361,6 +361,23 @@ static bool vcheck_v23_or_greater(const YKP_CONFIG *cfg) cfg->yk_major_version > 2; } +static bool vcheck_neo(const YKP_CONFIG *cfg) +{ + return (cfg->yk_major_version == 2 && + cfg->yk_minor_version == 1 && + cfg->yk_build_version >= 4 && + cfg->yk_build_version != 9); + +} + +static bool vcheck_neo_after_4(const YKP_CONFIG *cfg) +{ + return (cfg->yk_major_version == 2 && + cfg->yk_minor_version == 1 && + cfg->yk_build_version > 4 && + cfg->yk_build_version != 9); +} + static bool capability_has_hidtrig(const YKP_CONFIG *cfg) { return vcheck_v1(cfg); @@ -373,17 +390,17 @@ static bool capability_has_ticket_first(const YKP_CONFIG *cfg) static bool capability_has_static(const YKP_CONFIG *cfg) { - return vcheck_all(cfg); + return vcheck_all(cfg) && !vcheck_neo_after_4(cfg); } static bool capability_has_static_extras(const YKP_CONFIG *cfg) { - return vcheck_no_v1(cfg); + return vcheck_no_v1(cfg) && !vcheck_neo_after_4(cfg); } static bool capability_has_slot_two(const YKP_CONFIG *cfg) { - return vcheck_no_v1(cfg); + return vcheck_no_v1(cfg) && !vcheck_neo(cfg); } static bool capability_has_chal_resp(const YKP_CONFIG *cfg) @@ -393,17 +410,17 @@ static bool capability_has_chal_resp(const YKP_CONFIG *cfg) static bool capability_has_oath_imf(const YKP_CONFIG *cfg) { - return vcheck_v22_or_greater(cfg); + return vcheck_v22_or_greater(cfg) || vcheck_neo(cfg); } static bool capability_has_serial(const YKP_CONFIG *cfg) { - return vcheck_v22_or_greater(cfg); + return vcheck_v22_or_greater(cfg) || vcheck_neo(cfg); } static bool capability_has_oath(const YKP_CONFIG *cfg) { - return vcheck_v21_or_greater(cfg); + return vcheck_v21_or_greater(cfg) || vcheck_neo(cfg); } static bool capability_has_ticket_mods(const YKP_CONFIG *cfg)