From 588eb7526b04c4390df11b5c5a6894d2da32b451 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Fri, 17 Oct 2014 17:19:29 +0200 Subject: G3 needs transport PIN 123456 --- .../src/main/java/at/gv/egiz/smcc/STARCOSCard.java | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'smcc/src/main/java/at/gv') diff --git a/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java b/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java index 18595e45..027a5b7a 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java @@ -870,14 +870,26 @@ public class STARCOSCard extends AbstractSignatureCard implements PINMgmtSignatu resp = reader.modify(channel, apduSpec, provider, pinInfo); } else { - NewReferenceDataAPDUSpec apduSpec = new NewReferenceDataAPDUSpec( - new byte[] { - (byte) 0x00, (byte) 0x24, (byte) 0x00, pinInfo.getKID(), (byte) 0x10, - (byte) 0x25, (byte) 0x12, (byte) 0x34, (byte) 0x5f, (byte) 0xff, - (byte) 0xff, (byte) 0xff, (byte) 0xff, - (byte) 0x20, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, - (byte) 0xff, (byte) 0xff, (byte) 0xff }, - 1, VerifyAPDUSpec.PIN_FORMAT_BCD, 7, 4, 4); + NewReferenceDataAPDUSpec apduSpec; + if (generation < 4) { + apduSpec = new NewReferenceDataAPDUSpec( + new byte[] { + (byte) 0x00, (byte) 0x24, (byte) 0x00, pinInfo.getKID(), (byte) 0x10, + (byte) 0x26, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0x20, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff }, + 1, VerifyAPDUSpec.PIN_FORMAT_BCD, 7, 4, 4); + } else { + apduSpec = new NewReferenceDataAPDUSpec( + new byte[] { + (byte) 0x00, (byte) 0x24, (byte) 0x00, pinInfo.getKID(), (byte) 0x10, + (byte) 0x25, (byte) 0x12, (byte) 0x34, (byte) 0x5f, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0x20, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff }, + 1, VerifyAPDUSpec.PIN_FORMAT_BCD, 7, 4, 4); + } apduSpec.setPinInsertionOffsetNew(8); resp = reader.modify(channel, apduSpec, provider, pinInfo); } -- cgit v1.2.3