]> err.no Git - yubikey-personalization/commitdiff
restructure export text to be more accurate
authorKlas Lindfors <klas@yubico.com>
Tue, 16 Apr 2013 12:36:24 +0000 (14:36 +0200)
committerKlas Lindfors <klas@yubico.com>
Tue, 16 Apr 2013 14:00:41 +0000 (16:00 +0200)
ykpers-json.c
ykpers.c

index 31cf12c0af862f7497e914dc3a3b118c9414eb8a..f3bfb63196ca430f49c5f41b2c3b1dd83207af85 100644 (file)
@@ -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) {
index fe884e5369861066f788ee5dfab542b7c60238ee..6b83c183afed1342783495fe809fbfebc34063ec 100644 (file)
--- 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;
                        }