From: Klas Lindfors Date: Tue, 16 Apr 2013 12:36:24 +0000 (+0200) Subject: restructure export text to be more accurate X-Git-Tag: v1.13.0~24^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44a76cbaafe7be0991a4da67b14f1507a33478bd;p=yubikey-personalization restructure export text to be more accurate --- diff --git a/ykpers-json.c b/ykpers-json.c index 31cf12c..f3bfb63 100644 --- a/ykpers-json.c +++ b/ykpers-json.c @@ -46,18 +46,18 @@ int ykp_json_export_cfg(const YKP_CONFIG *cfg, char *json, size_t len) { int mode = MODE_OTP_YUBICO; struct map_st *p; - if((ycfg.cfgFlags & CFGFLAG_STATIC_TICKET) == CFGFLAG_STATIC_TICKET) { - mode = MODE_STATIC_TICKET; - } - else if((ycfg.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP){ - if((ycfg.cfgFlags & CFGFLAG_CHAL_YUBICO) == CFGFLAG_CHAL_YUBICO) { - mode = MODE_CHAL_YUBICO; - } else if((ycfg.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) { + if((ycfg.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP){ + if((ycfg.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) { mode = MODE_CHAL_HMAC; + } else if((ycfg.cfgFlags & CFGFLAG_CHAL_YUBICO) == CFGFLAG_CHAL_YUBICO) { + mode = MODE_CHAL_YUBICO; } else { mode = MODE_OATH_HOTP; } } + else if((ycfg.cfgFlags & CFGFLAG_STATIC_TICKET) == CFGFLAG_STATIC_TICKET) { + mode = MODE_STATIC_TICKET; + } for(p = _modes_map; p->flag; p++) { if(p->flag == mode) { diff --git a/ykpers.c b/ykpers.c index fe884e5..6b83c18 100644 --- a/ykpers.c +++ b/ykpers.c @@ -863,10 +863,10 @@ static int ykp_legacy_export_config(const YKP_CONFIG *cfg, char *buf, size_t len int pos = 0; if((ycfg.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP){ - if((ycfg.cfgFlags & CFGFLAG_CHAL_YUBICO) == CFGFLAG_CHAL_YUBICO) { - mode = MODE_CHAL_YUBICO; - } else if((ycfg.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) { + if((ycfg.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) { mode = MODE_CHAL_HMAC; + } else if((ycfg.cfgFlags & CFGFLAG_CHAL_YUBICO) == CFGFLAG_CHAL_YUBICO) { + mode = MODE_CHAL_YUBICO; } else { mode = MODE_OATH_HOTP; }