summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-04-23 11:38:22 +0200
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-04-23 11:38:22 +0200
commitcbd719a487362c2641e73889f5727981249e2d5f (patch)
treeb6d1eb15c1996ccd3208e536cc6c841b2f5a5770
parent30c89ccf6c90d10cf3c21d2a64082b89d8adcfd9 (diff)
downloadmocca-cbd719a487362c2641e73889f5727981249e2d5f.tar.gz
mocca-cbd719a487362c2641e73889f5727981249e2d5f.tar.bz2
mocca-cbd719a487362c2641e73889f5727981249e2d5f.zip
Infobox decryption for G4
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java16
1 files changed, 12 insertions, 4 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 027a5b7a..1e337f50 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
@@ -307,11 +307,19 @@ public class STARCOSCard extends AbstractSignatureCard implements PINMgmtSignatu
if (box.isEncrypted()) {
execSELECT_AID(channel, AID_DF_GS);
-
- execMSE(channel, 0x41, 0xb8, new byte[] {
- (byte) 0x84, (byte) 0x03, (byte) 0x80, (byte) 0x03, (byte) 0x00,
- (byte) 0x80, (byte) 0x01, (byte) 0x81});
+ byte[] tlv;
+ if (generation < 4)
+ tlv = new byte[] {
+ (byte) 0x84, (byte) 0x03, (byte) 0x80, (byte) 0x03, (byte) 0x00,
+ (byte) 0x80, (byte) 0x01, (byte) 0x81};
+ else
+ tlv = new byte[] {
+ (byte) 0x84, (byte) 0x01, (byte) 0x83,
+ (byte) 0x95, (byte) 0x01, (byte) 0x40,
+ (byte) 0x80, (byte) 0x01, (byte) 0x10};
+
+ execMSE(channel, 0x41, 0xb8, tlv);
byte[] plainKey = null;