summaryrefslogtreecommitdiff
path: root/smcc/src
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2014-10-17 17:19:29 +0200
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2014-10-17 17:19:45 +0200
commit588eb7526b04c4390df11b5c5a6894d2da32b451 (patch)
tree8497ae3f3b8d25f52c595621fc9054f8efe39baa /smcc/src
parentb5791b28f3be6b0746cc6b174a7a2a79e469c363 (diff)
downloadmocca-588eb7526b04c4390df11b5c5a6894d2da32b451.tar.gz
mocca-588eb7526b04c4390df11b5c5a6894d2da32b451.tar.bz2
mocca-588eb7526b04c4390df11b5c5a6894d2da32b451.zip
G3 needs transport PIN 123456
Diffstat (limited to 'smcc/src')
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java28
-rw-r--r--smcc/src/test/resources/at/gv/egiz/smcc/test/ecard/ECardG3ActivateTest.xml5
2 files changed, 22 insertions, 11 deletions
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);
}
diff --git a/smcc/src/test/resources/at/gv/egiz/smcc/test/ecard/ECardG3ActivateTest.xml b/smcc/src/test/resources/at/gv/egiz/smcc/test/ecard/ECardG3ActivateTest.xml
index 8bc39510..9fec2d42 100644
--- a/smcc/src/test/resources/at/gv/egiz/smcc/test/ecard/ECardG3ActivateTest.xml
+++ b/smcc/src/test/resources/at/gv/egiz/smcc/test/ecard/ECardG3ActivateTest.xml
@@ -48,7 +48,7 @@
<map>
<entry key="0x01">
<bean parent="kartenPIN">
- <property name="pin" value="25:12:34:5f:ff:ff:ff:ff" />
+ <property name="pin" value="26:12:34:56:ff:ff:ff:ff" />
<property name="state">
<util:constant static-field="at.gv.egiz.smcc.PIN.STATE_PIN_NOTACTIVE" />
</property>
@@ -76,11 +76,10 @@
<property name="state">
<util:constant static-field="at.gv.egiz.smcc.PIN.STATE_PIN_NOTACTIVE" />
</property>
- <property name="pin" value="25:12:34:5f:ff:ff:ff:ff" />
</bean>
</entry>
</map>
</property>
</bean>
-</beans> \ No newline at end of file
+</beans>