From c9f88bb9f13e0252f9f7defe1ba15f94f428fca2 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 4 Sep 2015 17:03:52 +0900 Subject: [PATCH] card serial number change --- ChangeLog | 7 +++++++ NEWS | 13 +++++++++++++ src/configure | 1 + src/openpgp-do.c | 11 +++++++---- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb0c136..19a2fb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-09-04 Niibe Yutaka + + * src/openpgp-do.c (do_openpgpcard_aid): Use upper bytes of unique + ID of MCU; same as USB serial number. + + * src/configure (help): Add NITROKEY_START. + 2015-08-26 Mateusz Zalega * GNUK_USB_DEVICE_ID: Add Nitrokey Start. diff --git a/NEWS b/NEWS index 1852c7f..f7fe0f7 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,18 @@ Gnuk NEWS - User visible changes +* Major changes in Gnuk 1.1.8 + + Released 2015-09-??, by NIIBE Yutaka + +** Upgrade of Chopstx +We use Chopstx 0.09, which supports Nitroky-Start. + +** Card serial number +The way to determine a serial number of Gnuk Token for card has been +changed. It uses the 96-bit unique bits of MCU, but the portion for +use is changed. + + * Major changes in Gnuk 1.1.7 Released 2015-08-05, by NIIBE Yutaka diff --git a/src/configure b/src/configure index 62ba981..b701ce5 100755 --- a/src/configure +++ b/src/configure @@ -107,6 +107,7 @@ Configuration: STBEE STBEE_MINI MAPLE_MINI + NITROKEY_START CQ_STARM FST_01_00 (unreleased version with 8MHz XTAL) --enable-debug debug with virtual COM port [no] diff --git a/src/openpgp-do.c b/src/openpgp-do.c index c29df0a..46192b9 100644 --- a/src/openpgp-do.c +++ b/src/openpgp-do.c @@ -631,16 +631,19 @@ do_openpgpcard_aid (uint16_t tag, int with_tag) if (vid == 0xffff || vid == 0x0000) { - const uint8_t *u = unique_device_id (); + const uint8_t *u = unique_device_id () + 8; memcpy (res_p, openpgpcard_aid, 8); res_p += 8; - /* vid == 0xfffe: serial number is random byte */ + /* vid == 0xfffe: serial number is four random bytes */ *res_p++ = 0xff; *res_p++ = 0xfe; - memcpy (res_p, u, 4); - res_p += 4; + + *res_p++ = u[3]; + *res_p++ = u[2]; + *res_p++ = u[1]; + *res_p++ = u[0]; } else {