在同一个applet成功安装(和删除)两次之后,我无法再在我的Java Card上安装applet了。
设置涉及:
一般卡信息:
$ gp-pro --info --debug --verbose
GlobalPlatformPro v0.3.9-26-gf426164
Running on Linux 4.11.3-1-ARCH amd64, Java 1.8.0_121 by Oracle Corporation
[DEBUG] PlaintextKeys - static keys:
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
# Detected readers from JNA2PCSC
[ ] Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 00
[*] Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01
SCardConnect("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01", T=*) -> T=1, 3B89800141434F534A763130311A
SCardBeginTransaction("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01")
Reader: Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01
ATR: 3B89800141434F534A763130311A
More information about your card:
http://smartcard-atr.appspot.com/parse?ATR=3B89800141434F534A763130311A
A>> T=1 (4+0000) 00A40400 00
A<< (0094+2) (61ms) 6F5C8408A000000151000000A550734A06072A864886FC6B01600C060A2A864886FC6B02020201630906072A864886FC6B03640B06092A864886FC6B040255650B06092A864886FC6B020103660C060A2B060104012A026E01039F6501FF 9000
[DEBUG] GlobalPlatform - Auto-detected ISD AID: A000000151000000
[DEBUG] GlobalPlatform - Auto-detected GP version: GP22
[DEBUG] GlobalPlatform - Auto-detected block size: 255
***** Card info:
A>> T=1 (4+0000) 80CA9F7F 00
A<< (0000+2) (14ms) 6A88
[DEBUG] GlobalPlatform - GET DATA(CPLC) returned SW: 6A88
NO CPLC
***** CARD DATA
A>> T=1 (4+0000) 80CA0066 00
A<< (0078+2) (20ms) 664C734A06072A864886FC6B01600C060A2A864886FC6B02020201630906072A864886FC6B03640B06092A864886FC6B040255650B06092A864886FC6B020103660C060A2B060104012A026E0103 9000
Unknown tag: 4c
***** KEY INFO
A>> T=1 (4+0000) 80CA00E0 00
A<< (0020+2) (13ms) E012C00401208010C00402208010C00403208010 9000
VER:32 ID:1 TYPE:DES3 LEN:16
VER:32 ID:2 TYPE:DES3 LEN:16
VER:32 ID:3 TYPE:DES3 LEN:16
SCardEndTransaction()
SCardDisconnect("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01", true)
卡的内容:
$ gp-pro --list --debug --verbose
GlobalPlatformPro v0.3.9-26-gf426164
Running on Linux 4.11.3-1-ARCH amd64, Java 1.8.0_121 by Oracle Corporation
[DEBUG] PlaintextKeys - static keys:
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
# Detected readers from JNA2PCSC
[ ] Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 00
[*] Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01
SCardConnect("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01", T=*) -> T=1, 3B89800141434F534A763130311A
SCardBeginTransaction("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01")
Reader: Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01
ATR: 3B89800141434F534A763130311A
More information about your card:
http://smartcard-atr.appspot.com/parse?ATR=3B89800141434F534A763130311A
A>> T=1 (4+0000) 00A40400 00
A<< (0094+2) (60ms) 6F5C8408A000000151000000A550734A06072A864886FC6B01600C060A2A864886FC6B02020201630906072A864886FC6B03640B06092A864886FC6B040255650B06092A864886FC6B020103660C060A2B060104012A026E01039F6501FF 9000
[DEBUG] GlobalPlatform - Auto-detected ISD AID: A000000151000000
[DEBUG] GlobalPlatform - Auto-detected GP version: GP22
[DEBUG] GlobalPlatform - Auto-detected block size: 255
A>> T=1 (4+0008) 80500000 08 997728AF7718D9D0 00
A<< (0028+2) (23ms) 000002650183039536622002009F84CEF1BFDB16D8BA6EFD53BD6121 9000
[DEBUG] GlobalPlatform - Host challenge: 997728AF7718D9D0
[DEBUG] GlobalPlatform - Card challenge: 009F84CEF1BFDB16
[DEBUG] GlobalPlatform - Card reports SCP02 with version 32 keys
[DEBUG] PlaintextKeys - session keys:
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:A5797275765F7FF0CBE8B18C26DEFA63 KCV: D976D3
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:C33CA06593C585A676C31E185597CA2F KCV: 851D4A
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:E0DA147FCBE037600ECFB4374CDDB727 KCV: E96244
[DEBUG] GlobalPlatform - Verified card cryptogram: D8BA6EFD53BD6121
[DEBUG] GlobalPlatform - Calculated host cryptogram: DDE5E44B37C24F2B
A>> T=1 (4+0016) 84820100 10 DDE5E44B37C24F2B5B0364A17273FCBE
A<< (0000+2) (28ms) 9000
A>> T=1 (4+0010) 84F28002 0A 4F00A81FC2FCEFC4991D 00
A<< (0021+2) (20ms) E3134F08A0000001510000009F700101C5039EDE00 9000
A>> T=1 (4+0010) 84F24002 0A 4F00C91EF58ED44DAB70 00
A<< (0000+2) (22ms) 6A88
A>> T=1 (4+0010) 84F22002 0A 4F00C4D3F1DE4D39F6CE 00
A<< (0015+2) (24ms) E30D4F07A00000015153509F700101 9000
A>> T=1 (4+0010) 84F21002 0A 4F006435B654480BD772 00
A<< (0025+2) (27ms) E3174F07A00000015153509F7001018408A000000151535041 9000
# Mode: GP22
ISD: A000000151000000 (OP_READY)
Privs: SecurityDomain, CardLock, CardTerminate, CardReset, CVMManagement, TrustedPath, AuthorizedManagement, GlobalDelete, GlobalLock, GlobalRegistry, FinalApplication
PKG: A0000001515350 (LOADED) (|....QSP|)
Applet: A000000151535041 (|....QSPA|)
SCardEndTransaction()
SCardDisconnect("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01", true)
尝试安装applet:
$ gp-pro --install smartpgp.cap --debug --verbose
GlobalPlatformPro v0.3.9-26-gf426164
Running on Linux 4.11.3-1-ARCH amd64, Java 1.8.0_121 by Oracle Corporation
[DEBUG] PlaintextKeys - static keys:
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F KCV: 8BAF47
# Detected readers from JNA2PCSC
[ ] Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 00
[*] Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01
SCardConnect("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01", T=*) -> T=1, 3B89800141434F534A763130311A
SCardBeginTransaction("Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01")
Reader: Cherry SC Reader (046A:0092) (OKCM0032209141841184149324404368) 00 01
ATR: 3B89800141434F534A763130311A
More information about your card:
http://smartcard-atr.appspot.com/parse?ATR=3B89800141434F534A763130311A
A>> T=1 (4+0000) 00A40400 00
A<< (0094+2) (60ms) 6F5C8408A000000151000000A550734A06072A864886FC6B01600C060A2A864886FC6B02020201630906072A864886FC6B03640B06092A864886FC6B040255650B06092A864886FC6B020103660C060A2B060104012A026E01039F6501FF 9000
[DEBUG] GlobalPlatform - Auto-detected ISD AID: A000000151000000
[DEBUG] GlobalPlatform - Auto-detected GP version: GP22
[DEBUG] GlobalPlatform - Auto-detected block size: 255
A>> T=1 (4+0008) 80500000 08 679425CBDD4F44DC 00
A<< (0028+2) (23ms) 000002650183039536622002009CA58A6D77C4681FF9409A201BED61 9000
[DEBUG] GlobalPlatform - Host challenge: 679425CBDD4F44DC
[DEBUG] GlobalPlatform - Card challenge: 009CA58A6D77C468
[DEBUG] GlobalPlatform - Card reports SCP02 with version 32 keys
[DEBUG] PlaintextKeys - session keys:
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:1BA6EBAD460F5396C70E2605726C2CD1 KCV: BFDA37
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:61BAA9D6003C14E7C65A8FF2A4A275A8 KCV: B7BD6F
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:1AB1FA470FB34528804854E0EE9323ED KCV: 29AE49
[DEBUG] GlobalPlatform - Verified card cryptogram: 1FF9409A201BED61
[DEBUG] GlobalPlatform - Calculated host cryptogram: A2A3559D66739175
A>> T=1 (4+0016) 84820100 10 A2A3559D6673917542E6D95D954F6BCF
A<< (0000+2) (28ms) 9000
CAP file (v2.1) generated on Sun Jun 04 06:26:53 CEST 2017
By Oracle Corporation converter [v3.0.5] with JDK 1.8.0_121 (Oracle Corporation)
Package: fr.anssi.smartpgp v1.0 with AID D27600012401
Applet: SmartPGPApplet with AID D276000124010302AFAF000000000000
Import: A0000000620001 v1.0
Import: A0000000620102 v1.6
Import: A0000000620101 v1.6
Import: A0000000620201 v1.6
Total code size: 19650 bytes (23213 with debug)
SHA256 (code): 1D5DC804F5717A5223E3781E513E0721304952DF041C9948E9812823D26D06E6
SHA1 (code): 643BEDB7BE8F31CD132148CBC8F8C437C1A19CB1
A>> T=1 (4+0010) 84F28002 0A 4F0058A916B464677333 00
A<< (0021+2) (19ms) E3134F08A0000001510000009F700101C5039EDE00 9000
A>> T=1 (4+0010) 84F24002 0A 4F0021C42E3A2F543FCC 00
A<< (0000+2) (22ms) 6A88
A>> T=1 (4+0010) 84F22002 0A 4F002B7CC7DD76018728 00
A<< (0015+2) (24ms) E30D4F07A00000015153509F700101 9000
A>> T=1 (4+0010) 84F21002 0A 4F0096EFFB8E668E98B5 00
A<< (0025+2) (27ms) E3174F07A00000015153509F7001018408A000000151535041 9000
A>> T=1 (4+0027) 84E60200 1B 06D2760001240108A0000001510000000000004BF30032D2A47207
A<< (0001+2) (91ms) 00 9000
A>> T=1 (4+0255) 84E80000 FF C4824CC2010010DECAFFED010204000106D2760001240102001F0010001F00140029052A011035B60837081400000DE800640032079704010004002904000107A0000000620001060107A0000000620102060107A0000000620101060107A00000006202010300140110D276000124010302AFAF0000000000001B83060110008000030003010300000009001300330080000500050107000000DC00F10127016C01CE01FA029B00800000FF000100000000800000FF000100000000800000FF00010000000080000100010101000004AE0080000802060102000005B905D100800001000101030000063C064906620080000803050111F0BEE357E02F7CD6
A<< (0000+2) (486ms) 643A
pro.javacard.gp.GPException: LOAD failed SW: 643A
at pro.javacard.gp.GPException.check(GPException.java:66)
at pro.javacard.gp.GlobalPlatform.loadCapFile(GlobalPlatform.java:667)
at pro.javacard.gp.GlobalPlatform.loadCapFile(GlobalPlatform.java:625)
at pro.javacard.gp.GPTool.main(GPTool.java:565)
LOAD failed SW: 643A
我和至少其他三个不同的小程序一样出错。
互联网告诉我们这个错误是什么:
0x643a超出卡片小程序包。
- 原因:安装小程序包失败,因为已超出可存储在卡上的小程序包数量。
- 解决方案:从CREF中删除一些applet包。
但是卡片和我第一次使用它时一样空。无论如何,这个CREF是什么?卡模拟器?
在此失败之前我做了什么:
所有这些都没有错误。但现在我无法安装任何东西。这就像两个小程序没有真正删除,而EEPROM如果已满。但是卡片的内容中没有小程序出现(使用gp-pro -l)。我没有找到任何“重置”卡或“格式化”EEPROM的东西。
这些幻像包发生了什么?