From c8bcb69988b2afa973bafaaefc62831750487d10 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 11 Jan 2011 12:07:44 +0900 Subject: [PATCH] fixed serial number ID --- ChangeLog | 4 ++++ src/openpgp-do.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9b6ec38..6841f47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-01-11 NIIBE Yutaka + + * src/openpgp-do.c (do_openpgpcard_aid): Fix length of res_p; + 2011-01-08 NIIBE Yutaka * src/usb-icc.c (icc_handle_data): Handle the case of diff --git a/src/openpgp-do.c b/src/openpgp-do.c index f80f7e4..d6b4cea 100644 --- a/src/openpgp-do.c +++ b/src/openpgp-do.c @@ -405,9 +405,11 @@ do_kgtime_all (uint16_t tag, int with_tag) const uint8_t openpgpcard_aid_template[] = { 0xd2, 0x76, 0x00, 0x01, 0x24, 0x01, 0x02, 0x00, /* Version 2.0 */ - 0xf5, 0x17, /* Manufacturer: FSIJ */ #if defined(SERIAL_NUMBER_IN_AID) + 0xf5, 0x17, /* Manufacturer: FSIJ */ SERIAL_NUMBER_IN_AID +#else + 0xff, 0xfe, /* Random bytes */ #endif }; @@ -428,6 +430,7 @@ do_openpgpcard_aid (uint16_t tag, int with_tag) res_p += sizeof (openpgpcard_aid_template); #if !defined(SERIAL_NUMBER_IN_AID) memcpy (res_p, u, 4); + res_p += 4; #endif *res_p++ = 0; *res_p++ = 0;