From: Klas Lindfors Date: Fri, 7 Jun 2013 11:08:21 +0000 (+0200) Subject: add ykp_{get,set}_acccode_type() X-Git-Tag: v1.14.0~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88e8e957abeb77f97c73a95c669459b1dcbaa111;p=yubikey-personalization add ykp_{get,set}_acccode_type() --- diff --git a/libykpers-1.map b/libykpers-1.map index 66e77df..ac36839 100644 --- a/libykpers-1.map +++ b/libykpers-1.map @@ -238,5 +238,7 @@ LIBYKPERS_1.14 { ykp_get_extflag_DORMANT; ykp_get_extflag_LED_INV; ykp_clear_config; + ykp_set_acccode_type; + ykp_get_acccode_type; # Variables: } LIBYKPERS_1.13; diff --git a/ykpers.c b/ykpers.c index 7931a26..df6f29f 100644 --- a/ykpers.c +++ b/ykpers.c @@ -1115,6 +1115,16 @@ int ykp_config_num(YKP_CONFIG *cfg) return 0; } +void ykp_set_acccode_type(YKP_CONFIG *cfg, unsigned int type) +{ + cfg->ykp_acccode_type = type; +} + +unsigned int ykp_get_acccode_type(const YKP_CONFIG *cfg) +{ + return cfg->ykp_acccode_type; +} + int * _ykp_errno_location(void) { static int tsd_init = 0; diff --git a/ykpers.h b/ykpers.h index a1a2b42..e9047b6 100644 --- a/ykpers.h +++ b/ykpers.h @@ -183,6 +183,13 @@ int ykp_import_config(YKP_CONFIG *cfg, const char *buf, size_t len, int format); #define YKP_FORMAT_LEGACY 0x01 #define YKP_FORMAT_YCFG 0x02 +void ykp_set_acccode_type(YKP_CONFIG *cfg, unsigned int type); +unsigned int ykp_get_acccode_type(const YKP_CONFIG *cfg); + +#define YKP_ACCCODE_NONE 0x00 +#define YKP_ACCCODE_RANDOM 0x01 +#define YKP_ACCCODE_SERIAL 0x02 + extern int * _ykp_errno_location(void); #define ykp_errno (*_ykp_errno_location()) const char *ykp_strerror(int errnum); diff --git a/ykpers_lcl.h b/ykpers_lcl.h index 228260b..52af7b9 100644 --- a/ykpers_lcl.h +++ b/ykpers_lcl.h @@ -45,6 +45,8 @@ struct ykp_config_t { unsigned int command; YK_CONFIG ykcore_config; + + unsigned int ykp_acccode_type; }; extern bool capability_has_hidtrig(const YKP_CONFIG *cfg);