]> err.no Git - yubikey-personalization/commitdiff
add getter functions for all configflags
authorKlas Lindfors <klas@yubico.com>
Tue, 30 Apr 2013 11:34:23 +0000 (13:34 +0200)
committerKlas Lindfors <klas@yubico.com>
Tue, 30 Apr 2013 11:34:23 +0000 (13:34 +0200)
libykpers-1.map
ykpers.c
ykpers.h

index f080efa3f8c403f5d9d465128227e47953751ba2..66e77dfffb34a1ff9e23a6f5d0c0ce7b36a3f0bf 100644 (file)
@@ -202,6 +202,41 @@ LIBYKPERS_1.13 {
 LIBYKPERS_1.14 {
   global:
 # Functions:
+  ykp_get_cfgflag_ALLOW_HIDTRIG;
+  ykp_get_cfgflag_MAN_UPDATE;
+  ykp_get_cfgflag_PACING_10MS;
+  ykp_get_cfgflag_PACING_20MS;
+  ykp_get_cfgflag_SEND_REF;
+  ykp_get_cfgflag_SHORT_TICKET;
+  ykp_get_cfgflag_STATIC_TICKET;
+  ykp_get_cfgflag_STRONG_PW1;
+  ykp_get_cfgflag_STRONG_PW2;
+  ykp_get_cfgflag_TICKET_FIRST;
+  ykp_get_cfgflag_OATH_HOTP8;
+  ykp_get_cfgflag_OATH_FIXED_MODHEX1;
+  ykp_get_cfgflag_OATH_FIXED_MODHEX2;
+  ykp_get_cfgflag_OATH_FIXED_MODHEX;
+  ykp_get_tktflag_APPEND_CR;
+  ykp_get_tktflag_APPEND_DELAY1;
+  ykp_get_tktflag_APPEND_DELAY2;
+  ykp_get_tktflag_APPEND_TAB1;
+  ykp_get_tktflag_APPEND_TAB2;
+  ykp_get_tktflag_PROTECT_CFG2;
+  ykp_get_tktflag_TAB_FIRST;
+  ykp_get_tktflag_OATH_HOTP;
+  ykp_get_tktflag_CHAL_RESP;
+  ykp_get_cfgflag_CHAL_YUBICO;
+  ykp_get_cfgflag_CHAL_HMAC;
+  ykp_get_cfgflag_HMAC_LT64;
+  ykp_get_cfgflag_CHAL_BTN_TRIG;
+  ykp_get_extflag_SERIAL_BTN_VISIBLE;
+  ykp_get_extflag_SERIAL_USB_VISIBLE;
+  ykp_get_extflag_SERIAL_API_VISIBLE;
+  ykp_get_extflag_USE_NUMERIC_KEYPAD;
+  ykp_get_extflag_FAST_TRIG;
+  ykp_get_extflag_ALLOW_UPDATE;
+  ykp_get_extflag_DORMANT;
+  ykp_get_extflag_LED_INV;
   ykp_clear_config;
 # Variables:
 } LIBYKPERS_1.13;
index 8ec394e0775ec47ce6addefdb455cfa113a19346..5945104e00a35893cccb7d36a26f088c680c3b9a 100644 (file)
--- a/ykpers.c
+++ b/ykpers.c
@@ -769,8 +769,20 @@ int ykp_set_tktflag_ ## type(YKP_CONFIG *cfg, bool state)  \
        }                                                       \
        ykp_errno = YKP_ENOCFG;                                 \
        return 0;                                               \
+} \
+bool ykp_get_tktflag_ ## type(YKP_CONFIG *cfg)                 \
+{                                                              \
+       if (cfg) {                                              \
+               if(cfg->ykcore_config.tktFlags & TKTFLAG_ ## type)      \
+                       return true;                            \
+               else                                            \
+                       return false;                           \
+       }                                                       \
+       return false;                                           \
 }
 
+
+
 #define def_set_cfgflag(type,capability)                       \
 int ykp_set_cfgflag_ ## type(YKP_CONFIG *cfg, bool state)      \
 {                                                              \
@@ -787,8 +799,19 @@ int ykp_set_cfgflag_ ## type(YKP_CONFIG *cfg, bool state)  \
        }                                                       \
        ykp_errno = YKP_ENOCFG;                                 \
        return 0;                                               \
+}                                                              \
+bool ykp_get_cfgflag_ ## type(YKP_CONFIG *cfg)                 \
+{                                                              \
+       if (cfg) {                                              \
+               if(cfg->ykcore_config.cfgFlags & CFGFLAG_ ## type)      \
+                       return true;                            \
+               else                                            \
+                       return false;                           \
+       }                                                       \
+       return false;                                           \
 }
 
+
 #define def_set_extflag(type,capability)                       \
 int ykp_set_extflag_ ## type(YKP_CONFIG *cfg, bool state)      \
 {                                                              \
@@ -805,6 +828,16 @@ int ykp_set_extflag_ ## type(YKP_CONFIG *cfg, bool state)  \
        }                                                       \
        ykp_errno = YKP_ENOCFG;                                 \
        return 0;                                               \
+}                                                              \
+bool ykp_get_extflag_ ## type(YKP_CONFIG *cfg)                 \
+{                                                              \
+       if (cfg) {                                              \
+               if(cfg->ykcore_config.extFlags & EXTFLAG_ ## type)      \
+                       return true;                            \
+               else                                            \
+                       return false;                           \
+       }                                                       \
+       return false;                                           \
 }
 
 def_set_tktflag(TAB_FIRST,capability_has_ticket_mods)
index 0bab83cb0e1d6d4fe64fe150970a06ceecf468da..a1a2b427a67aa3f82539a536210ba4f50b648c8e 100644 (file)
--- a/ykpers.h
+++ b/ykpers.h
@@ -124,6 +124,44 @@ int ykp_set_extflag_ALLOW_UPDATE (YKP_CONFIG *cfg, bool state);
 int ykp_set_extflag_DORMANT (YKP_CONFIG *cfg, bool state);
 int ykp_set_extflag_LED_INV (YKP_CONFIG *cfg, bool state);
 
+bool ykp_get_tktflag_TAB_FIRST(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_APPEND_TAB1(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_APPEND_TAB2(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_APPEND_DELAY1(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_APPEND_DELAY2(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_APPEND_CR(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_PROTECT_CFG2(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_OATH_HOTP(YKP_CONFIG *cfg);
+bool ykp_get_tktflag_CHAL_RESP(YKP_CONFIG *cfg);
+
+bool ykp_get_cfgflag_SEND_REF(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_TICKET_FIRST(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_PACING_10MS(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_PACING_20MS(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_ALLOW_HIDTRIG(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_STATIC_TICKET(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_SHORT_TICKET(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_STRONG_PW1(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_STRONG_PW2(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_MAN_UPDATE(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_OATH_HOTP8(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_OATH_FIXED_MODHEX1(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_OATH_FIXED_MODHEX2(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_OATH_FIXED_MODHEX(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_CHAL_YUBICO(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_CHAL_HMAC(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_HMAC_LT64(YKP_CONFIG *cfg);
+bool ykp_get_cfgflag_CHAL_BTN_TRIG(YKP_CONFIG *cfg);
+
+bool ykp_get_extflag_SERIAL_BTN_VISIBLE(YKP_CONFIG *cfg);
+bool ykp_get_extflag_SERIAL_USB_VISIBLE(YKP_CONFIG *cfg);
+bool ykp_get_extflag_SERIAL_API_VISIBLE (YKP_CONFIG *cfg);
+bool ykp_get_extflag_USE_NUMERIC_KEYPAD (YKP_CONFIG *cfg);
+bool ykp_get_extflag_FAST_TRIG (YKP_CONFIG *cfg);
+bool ykp_get_extflag_ALLOW_UPDATE (YKP_CONFIG *cfg);
+bool ykp_get_extflag_DORMANT (YKP_CONFIG *cfg);
+bool ykp_get_extflag_LED_INV (YKP_CONFIG *cfg);
+
 int ykp_clear_config(YKP_CONFIG *cfg);
 
 int ykp_write_config(const YKP_CONFIG *cfg,