From 34207393dfe8c13ecd442b797a019c6d8601964b Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 9 Jan 2014 08:40:53 +0100 Subject: [PATCH] use ykp_get_supported_key_length() to get key length --- ykpersonalize.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ykpersonalize.c b/ykpersonalize.c index bf54a4f..acf7948 100644 --- a/ykpersonalize.c +++ b/ykpersonalize.c @@ -189,10 +189,8 @@ int main(int argc, char **argv) } else if (! zap && (ykp_command(cfg) == SLOT_CONFIG || ykp_command(cfg) == SLOT_CONFIG2)) { char keybuf[42]; size_t keylen; if(keylocation == 2) { - bool long_key = false; - 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))) { - long_key = true; + bool long_key = ykp_get_supported_key_length(cfg) == 20 ? true : false; + if(long_key == true) { fprintf(stderr, " HMAC key, up to 20 bytes (40 characters hex) : "); } else { fprintf(stderr, " AES key, 16 bytes (32 characters hex) : "); -- 2.39.5