From: Klas Lindfors Date: Tue, 27 Mar 2012 12:37:32 +0000 (+0200) Subject: add new extended flags for 2.3 X-Git-Tag: v1.7.0~1^2~50 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91e0dac4e6344be026d272cf999f177066e9d41b;p=yubikey-personalization add new extended flags for 2.3 USE_NUMERIC_KEYPAD, FAST_TRIG, ALLOW_UPDATE and DORMANT --- diff --git a/libykpers-1.map b/libykpers-1.map index e2b9a7e..fa3b7be 100644 --- a/libykpers-1.map +++ b/libykpers-1.map @@ -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; diff --git a/ykpers-args.c b/ykpers-args.c index 112e237..11a7499 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -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", diff --git a/ykpers.c b/ykpers.c index d65b9df..e96140b 100644 --- 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 } }; diff --git a/ykpers.h b/ykpers.h index 24f256c..fd84e59 100644 --- 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,