From: Klas Lindfors Date: Fri, 9 Nov 2012 12:27:09 +0000 (+0100) Subject: support for production NEO with new product id and version X-Git-Tag: v1.10.0~38 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6a9d7228423b7d05903e1e60d1b82ddd82520de;p=yubikey-personalization support for production NEO with new product id and version --- diff --git a/ykcore/ykcore.c b/ykcore/ykcore.c index 57702f4..f2f82b8 100644 --- a/ykcore/ykcore.c +++ b/ykcore/ykcore.c @@ -62,6 +62,11 @@ YK_KEY *yk_open_first_key(void) YK_KEY *yk = _ykusb_open_device(YUBICO_VID, YUBIKEY_PID); int rc = yk_errno; + if(!yk) { + yk = _ykusb_open_device(YUBICO_VID, YUBIKEY_NEO_PID); + rc = yk_errno; + } + if (yk) { YK_STATUS st; @@ -98,7 +103,9 @@ int yk_check_firmware_version(YK_KEY *k) (st.versionMinor == 0 || st.versionMinor == 1 || st.versionMinor == 2 || - st.versionMinor == 3)))) { + st.versionMinor == 3)) || + (st.versionMajor == 3 && + (st.versionMinor == 0)))) { yk_errno = YK_EFIRMWARE; return 0; } diff --git a/ykcore/ykdef.h b/ykcore/ykdef.h index 9f82e11..a81e942 100644 --- a/ykcore/ykdef.h +++ b/ykcore/ykdef.h @@ -27,6 +27,7 @@ #define YUBICO_VID 0x1050 #define YUBIKEY_PID 0x0010 +#define YUBIKEY_NEO_PID 0x0110 /* Slot entries */ diff --git a/ykpers.c b/ykpers.c index 655a5bd..c29f69b 100644 --- a/ykpers.c +++ b/ykpers.c @@ -186,8 +186,8 @@ int ykp_configure_command(YKP_CONFIG *cfg, uint8_t command) break; case SLOT_NDEF: /* NDEF is available for neo, thus within 2.1 from build 4 */ - if (!(cfg->yk_major_version == 2 && cfg->yk_minor_version == 1 && - cfg->yk_build_version >= 4)) { + if (!((cfg->yk_major_version == 2 && cfg->yk_minor_version == 1 && + cfg->yk_build_version >= 4) || cfg->yk_major_version == 3)) { ykp_errno = YKP_EYUBIKEYVER; return 0; }