]> err.no Git - yubikey-personalization/commitdiff
add targetConfig to export
authorKlas Lindfors <klas@yubico.com>
Thu, 25 Apr 2013 08:44:08 +0000 (10:44 +0200)
committerKlas Lindfors <klas@yubico.com>
Thu, 25 Apr 2013 08:59:38 +0000 (10:59 +0200)
ykpers-json.c

index 06965f1d8793630ce16212b0b4b6ad0075c3f618..285f1a71297a860fda991910e413771b5c461847 100644 (file)
@@ -45,6 +45,7 @@ int _ykp_json_export_cfg(const YKP_CONFIG *cfg, char *json, size_t len) {
 
                int mode = MODE_OTP_YUBICO;
                struct map_st *p;
+               json_object *target_config = NULL;
 
                if((ycfg.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP){
                        if((ycfg.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) {
@@ -67,6 +68,15 @@ int _ykp_json_export_cfg(const YKP_CONFIG *cfg, char *json, size_t len) {
                        }
                }
 
+               if(cfg->command == SLOT_CONFIG) {
+                       target_config = json_object_new_int(1);
+               } else if(cfg->command == SLOT_CONFIG2) {
+                       target_config = json_object_new_int(2);
+               }
+               if(target_config) {
+                       json_object_object_add(yprod_json, "targetConfig", target_config);
+               }
+
                json_object_object_add(jobj, "yubiProdConfig", yprod_json);
                json_object_object_add(yprod_json, "options", options_json);