From: Klas Lindfors Date: Mon, 11 Mar 2013 09:37:07 +0000 (+0100) Subject: add code for modifying EXTFLAG_LED_INV X-Git-Tag: v1.12.0~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=760d7d74dc21e9e743ba01f0ad9a4d1bb87ba9d8;p=yubikey-personalization add code for modifying EXTFLAG_LED_INV and bump library versions accordingly.. --- diff --git a/NEWS b/NEWS index 543c9b3..9a79063 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ Yubikey-personalize NEWS -- History of user-visible changes. -*- outline -*- -* Version 1.11.4 (unreleased) +* Version 1.12.0 (unreleased) * Version 1.11.3 (released 2013-01-09) diff --git a/configure.ac b/configure.ac index 360693e..43c2436 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -AC_INIT([yubikey-personalization], [1.11.4], +AC_INIT([yubikey-personalization], [1.12.0], [yubico-devel@googlegroups.com], [ykpers], [http://code.google.com/p/yubikey-personalization/]) AC_CONFIG_AUX_DIR([build-aux]) @@ -36,9 +36,9 @@ AC_CONFIG_MACRO_DIR([m4]) # Interfaces changed/added/removed: CURRENT++ REVISION=0 # Interfaces added: AGE++ # Interfaces removed: AGE=0 -AC_SUBST(LT_CURRENT, 13) -AC_SUBST(LT_REVISION, 3) -AC_SUBST(LT_AGE, 11) +AC_SUBST(LT_CURRENT, 14) +AC_SUBST(LT_REVISION, 0) +AC_SUBST(LT_AGE, 12) AM_INIT_AUTOMAKE([1.11.3 -Wall -Werror]) AM_SILENT_RULES([yes]) diff --git a/libykpers-1.map b/libykpers-1.map index d3457e3..87fc1cb 100644 --- a/libykpers-1.map +++ b/libykpers-1.map @@ -183,3 +183,10 @@ LIBYKPERS_1.11 { ykpers_check_version; # Variables: } LIBYKPERS_1.10; + +LIBYKPERS_1.12 { + global: +# Functions: + ykp_set_extflag_LED_INV; +# Variables: +} LIBYKPERS_1.11; diff --git a/ykpers.c b/ykpers.c index a355451..a76674b 100644 --- a/ykpers.c +++ b/ykpers.c @@ -579,6 +579,19 @@ static bool vcheck_v23_or_greater(const YKP_CONFIG *cfg) cfg->yk_major_version > 2; } +static bool vcheck_v24_or_greater(const YKP_CONFIG *cfg) +{ + return (cfg->yk_major_version == 2 && + cfg->yk_minor_version >= 4) || + cfg->yk_major_version > 2; +} + +static bool vcheck_v30(const YKP_CONFIG *cfg) +{ + return (cfg->yk_major_version == 3 && + cfg->yk_minor_version == 0); +} + static bool vcheck_neo(const YKP_CONFIG *cfg) { return (cfg->yk_major_version == 2 && @@ -672,6 +685,11 @@ static bool capability_has_dormant(const YKP_CONFIG *cfg) return vcheck_v23_or_greater(cfg); } +static bool capability_has_led_inv(const YKP_CONFIG *cfg) +{ + return (vcheck_v24_or_greater(cfg) && !vcheck_v30(cfg)); +} + int ykp_set_oath_imf(YKP_CONFIG *cfg, unsigned long imf) { if (!capability_has_oath_imf(cfg)) { @@ -822,6 +840,7 @@ def_set_extflag(USE_NUMERIC_KEYPAD,capability_has_numeric) def_set_extflag(FAST_TRIG,capability_has_fast) def_set_extflag(ALLOW_UPDATE,capability_has_update) def_set_extflag(DORMANT,capability_has_dormant) +def_set_extflag(LED_INV,capability_has_led_inv) const char str_key_value_separator[] = ": "; const char str_hex_prefix[] = "h:"; @@ -899,6 +918,7 @@ struct map_st extended_flags_map[] = { { EXTFLAG_FAST_TRIG, "FAST_TRIG", capability_has_fast, 0 }, { EXTFLAG_ALLOW_UPDATE, "ALLOW_UPDATE", capability_has_update, 0 }, { EXTFLAG_DORMANT, "DORMANT", capability_has_dormant, 0 }, + { EXTFLAG_LED_INV, "LED_INV", capability_has_led_inv, 0 }, { 0, "", 0, 0 } };