]> err.no Git - yubikey-personalization/commitdiff
add code for modifying EXTFLAG_LED_INV
authorKlas Lindfors <klas@yubico.com>
Mon, 11 Mar 2013 09:37:07 +0000 (10:37 +0100)
committerKlas Lindfors <klas@yubico.com>
Mon, 11 Mar 2013 10:13:45 +0000 (11:13 +0100)
and bump library versions accordingly..

NEWS
configure.ac
libykpers-1.map
ykpers.c

diff --git a/NEWS b/NEWS
index 543c9b3a0858463ca80f34485ce97fa04a97ff89..9a790631cbe705775868bf9039295f484bac7636 100644 (file)
--- 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)
 
index 360693e7f42994932e62703f447bab60f0c8b7e7..43c24369ace82efff2e10c7a2db1266dd95a48dd 100644 (file)
@@ -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])
index d3457e34b8470e0681cedf43a5bdb27c1cb2bf54..87fc1cb1444b788070b48f91c67c4883e2738928 100644 (file)
@@ -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;
index a355451f8a44f157e67affe35335e73ac7f9086a..a76674b7d60af3beff6878cf0bd88004e1a222f4 100644 (file)
--- 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 }
 };