]> err.no Git - yubikey-personalization/commitdiff
add new extended flags for 2.3
authorKlas Lindfors <klas@yubico.com>
Tue, 27 Mar 2012 12:37:32 +0000 (14:37 +0200)
committerKlas Lindfors <klas@yubico.com>
Tue, 27 Mar 2012 12:43:47 +0000 (14:43 +0200)
USE_NUMERIC_KEYPAD, FAST_TRIG, ALLOW_UPDATE and DORMANT

libykpers-1.map
ykpers-args.c
ykpers.c
ykpers.h

index e2b9a7e52c5feda222cc86e6919b08c759a7a20f..fa3b7be36a992cb27fd04e786277ace13dda391f 100644 (file)
@@ -133,5 +133,9 @@ LIBYKPERS_1.7 {
   ykp_command;
   ykp_configure_command;
   yk_write_command;
+  ykp_set_extflag_USE_NUMERIC_KEYPAD;
+  ykp_set_extflag_FAST_TRIG;
+  ykp_set_extflag_ALLOW_UPDATE;
+  ykp_set_extflag_DORMANT;
 # Variables:
 } LIBYKPERS_1.6;
index 112e2379333b8020368cfb629868eb1745d52c34..11a74999d5cba4eef4d3d8d34a5b6c6715ac0864 100644 (file)
@@ -124,6 +124,12 @@ const char *usage =
 "          [-]serial-usb-visible  set/clear SERIAL_USB_VISIBLE\n"
 "          [-]serial-api-visible  set/clear SERIAL_API_VISIBLE\n"
 "\n"
+"          Extended flags for firmware version 2.3 and above:\n"
+"          [-]use-numeric-keypad  set/clear USE_NUMERIC_KEYPAD\n"
+"          [-]fast-trig           set/clear FAST_TRIG\n"
+"          [-]allow-update        set/clear ALLOW_UPDATE\n"
+"          [-]dormant             set/clear DORMANT\n"
+"\n"
 "-y        always commit (do not prompt)\n"
 "\n"
 "-v        verbose\n"
@@ -498,6 +504,10 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg,
                        EXTFLAG("serial-btn-visible", SERIAL_BTN_VISIBLE)
                        EXTFLAG("serial-usb-visible", SERIAL_USB_VISIBLE)
                        EXTFLAG("serial-api-visible", SERIAL_API_VISIBLE)
+      EXTFLAG("use-numeric-keypad", USE_NUMERIC_KEYPAD)
+      EXTFLAG("fast-trig", FAST_TRIG)
+                       EXTFLAG("allow-update", ALLOW_UPDATE)
+      EXTFLAG("dormant", DORMANT)
 #undef EXTFLAG
                        else {
                                fprintf(stderr, "Unknown option '%s'\n",
index d65b9df006fdd7ff51d98e11f2dac3d2194c6209..e96140b24ee095e0d0fc84dfd0afc055b3731fd9 100644 (file)
--- a/ykpers.c
+++ b/ykpers.c
@@ -484,6 +484,10 @@ def_set_cfgflag(CHAL_BTN_TRIG,vcheck_v22_or_greater)
 def_set_extflag(SERIAL_BTN_VISIBLE,vcheck_v22_or_greater)
 def_set_extflag(SERIAL_USB_VISIBLE,vcheck_v22_or_greater)
 def_set_extflag(SERIAL_API_VISIBLE,vcheck_v22_or_greater)
+def_set_extflag(USE_NUMERIC_KEYPAD,vcheck_v23_or_greater)
+def_set_extflag(FAST_TRIG,vcheck_v23_or_greater)
+def_set_extflag(ALLOW_UPDATE,vcheck_v23_or_greater)
+def_set_extflag(DORMANT,vcheck_v23_or_greater)
 
 const char str_key_value_separator[] = ": ";
 const char str_hex_prefix[] = "h:";
@@ -556,6 +560,10 @@ struct map_st extended_flags_map[] = {
        { EXTFLAG_SERIAL_BTN_VISIBLE,   "SERIAL_BTN_VISIBLE",   vcheck_v22_or_greater,  0 },
        { EXTFLAG_SERIAL_USB_VISIBLE,   "SERIAL_USB_VISIBLE",   vcheck_v22_or_greater,  0 },
        { EXTFLAG_SERIAL_API_VISIBLE,   "SERIAL_API_VISIBLE",   vcheck_v22_or_greater,  0 },
+       { EXTFLAG_USE_NUMERIC_KEYPAD,   "USE_NUMERIC_KEYPAD",   vcheck_v23_or_greater,  0 },
+       { EXTFLAG_FAST_TRIG,            "FAST_TRIG",            vcheck_v23_or_greater,  0 },
+       { EXTFLAG_ALLOW_UPDATE,         "ALLOW_UPDATE",         vcheck_v23_or_greater,  0 },
+       { EXTFLAG_DORMANT,              "DORMANT",              vcheck_v23_or_greater,  0 },
        { 0, "", 0 }
 };
 
index 24f256c47fa33e566e63ccde73309fa452015246..fd84e5991efd6bfe578af1209c37f3375daa7dd9 100644 (file)
--- a/ykpers.h
+++ b/ykpers.h
@@ -96,6 +96,10 @@ int ykp_set_cfgflag_CHAL_BTN_TRIG(YKP_CONFIG *cfg, bool state);
 int ykp_set_extflag_SERIAL_BTN_VISIBLE(YKP_CONFIG *cfg, bool state);
 int ykp_set_extflag_SERIAL_USB_VISIBLE(YKP_CONFIG *cfg, bool state);
 int ykp_set_extflag_SERIAL_API_VISIBLE (YKP_CONFIG *cfg, bool state);
+int ykp_set_extflag_USE_NUMERIC_KEYPAD (YKP_CONFIG *cfg, bool state);
+int ykp_set_extflag_FAST_TRIG (YKP_CONFIG *cfg, bool state);
+int ykp_set_extflag_ALLOW_UPDATE (YKP_CONFIG *cfg, bool state);
+int ykp_set_extflag_DORMANT (YKP_CONFIG *cfg, bool state);
 
 int ykp_write_config(const YKP_CONFIG *cfg,
                     int (*writer)(const char *buf, size_t count,