问题描述
我创建了一个包含22个相等的applet的程序包.(这些applet在程序中是相等的,而在AID中是不同的.)
I create a package that contains 22 equal applets.(The applets are equal in program and different in AID.)
当我如下设置程序包AID和applet的AID时,一切正常. (我可以安装它,并且可以在gp -list
命令的响应中看到它)
When I set the package AID and applet's AIDs as below, everything is OK. (I can install it and I can see it in the response of gp -list
command)
App1 AID = 010203040501
App2 AID = 010203040502
App3 AID = 010203040503
App4 AID = 010203040504
App5 AID = 010203040505
App6 AID = 010203040506
App7 AID = 010203040507
App8 AID = 010203040508
App9 AID = 010203040509
App10 AID = 01020304050a
App11 AID = 01020304050b
App12 AID = 01020304050c
App13 AID = 01020304050d
App14 AID = 01020304050e
App15 AID = 01020304050f
App16 AID = 010203040510
App17 AID = 010203040511
App18 AID = 010203040512
App19 AID = 010203040513
App20 AID = 010203040514
App21 AID = 010203040515
App22 AID = 010203040516
看:
gp: gp -list
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
gp: gp -install e:\PackageWithShortAIDs.cap
gp: gp -list
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: 010203040507 (|......|)
App SELECTABLE: (none)
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
AID: 0102030405 (|.....|)
ExM LOADED: (none)
010203040507 (|......|)
010203040506 (|......|)
010203040505 (|......|)
010203040504 (|......|)
010203040503 (|......|)
010203040502 (|......|)
010203040501 (|......|)
010203040513 (|......|)
010203040512 (|......|)
010203040511 (|......|)
010203040510 (|......|)
01020304050F (|......|)
01020304050E (|......|)
01020304050D (|......|)
01020304050C (|......|)
01020304050B (|......|)
01020304050A (|......|)
010203040516 (|......|)
010203040515 (|......|)
010203040514 (|......|)
010203040509 (|......|)
010203040508 (|......|)
gp:
现在,我将我的Applet的AID更改为以下内容(其他与之前相同):
Now,I change I change the AID of Applets as below (everything else is the same as for before) :
App1 AID = 0102030405060708090001
App2 AID = 0102030405060708090002
App3 AID = 0102030405060708090003
App4 AID = 0102030405060708090004
App5 AID = 0102030405060708090005
App6 AID = 0102030405060708090006
App7 AID = 0102030405060708090007
App8 AID = 0102030405060708090008
App9 AID = 0102030405060708090009
App10 AID = 010203040506070809000a
App11 AID = 010203040506070809000b
App12 AID = 010203040506070809000c
App13 AID = 010203040506070809000d
App14 AID = 010203040506070809000e
App15 AID = 010203040506070809000f
App16 AID = 0102030405060708090010
App17 AID = 0102030405060708090011
App18 AID = 0102030405060708090012
App19 AID = 0102030405060708090013
App20 AID = 0102030405060708090014
App21 AID = 0102030405060708090015
App22 AID = 0102030405060708090016
在这种情况下,我可以加载并安装它.但是我无法再列出我已安装的小程序!
In this case, I can load and install it. But I can't list my installed applets anymore!
gp: gp -list
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
gp: gp -install e:\PackageWithLongAIDs.cap
gp: gp -list
javax.smartcardio.CardException: Get Status failed, SW: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
Exception in thread "main" javax.smartcardio.CardException: Get Status failed, S
W: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
gp:
为什么?!
更新:
调试模式-简短的AID:
.
.
.
A>> T=1 (4+0008) 80500000 08 9F6EB47CB0E1F31F
A<< (0028+2) (70ms) 00004198001714974248FF0200BD548DC44808E7509B8AD3DEACC41F 900
0
Host challenge: 9F6EB47CB0E1F31F
Card challenge: 00BD548DC44808E7
Card reports SCP02 with version 255 keys
Master keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
Sequnce counter: 00BD
Derived session keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:DAED14FD3E4D7E6DC2A87F618D5A9EAC
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:59AEDE4C2E3E891BB50AE82028E44BF0
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:4DD4DBE895A5CFC590D4B190BF0547AC
Verified card cryptogram: 509B8AD3DEACC41F
Calculated host cryptogram: 85D04425E8C0A4BA
A>> T=1 (4+0016) 84820100 10 85D04425E8C0A4BAB5F40665FC1D88EE
A<< (0000+2) (66ms) 9000
A>> T=1 (4+0010) 84F28000 0A 4F009E0E0DBD266DC260
A<< (0011+2) (46ms) 08A000000151000000019E 9000
A>> T=1 (4+0010) 84F24000 0A 4F0078DB90059DC6D376
A<< (0009+2) (44ms) 060102030405070700 9000
A>> T=1 (4+0010) 84F22000 0A 4F000EA20738A58D27B1
A<< (0018+2) (48ms) 07A000000151535001000501020304050100 9000
A>> T=1 (4+0010) 84F21000 0A 4F0006BC7C18D19E7BDB
A<< (0183+2) (101ms) 07A000000151535001000108A0000001515350410501020304050100160
60102030405070601020304050606010203040505060102030405040601020304050306010203040
50206010203040501060102030405130601020304051206010203040511060102030405100601020
304050F0601020304050E0601020304050D0601020304050C0601020304050B0601020304050A060
1020304051606010203040515060102030405140601020304050906010203040508 9000
AID: A000000151000000 (|....Q...|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: 010203040507 (|......|)
App SELECTABLE: (none)
AID: A0000001515350 (|....QSP|)
ExM LOADED: (none)
A000000151535041 (|....QSPA|)
AID: 0102030405 (|.....|)
ExM LOADED: (none)
010203040507 (|......|)
010203040506 (|......|)
010203040505 (|......|)
010203040504 (|......|)
010203040503 (|......|)
010203040502 (|......|)
010203040501 (|......|)
010203040513 (|......|)
010203040512 (|......|)
010203040511 (|......|)
010203040510 (|......|)
01020304050F (|......|)
01020304050E (|......|)
01020304050D (|......|)
01020304050C (|......|)
01020304050B (|......|)
01020304050A (|......|)
010203040516 (|......|)
010203040515 (|......|)
010203040514 (|......|)
010203040509 (|......|)
010203040508 (|......|)
SCardEndTransaction()
SCardDisconnect("ACS CCID USB Reader 0", false)
gp:
调试模式-长AID:
.
.
.
A>> T=1 (4+0008) 80500000 08 E81EAC2B833E5DCF
A<< (0028+2) (70ms) 00004198001714974248FF0200B93785186688F163331EF41FA02CB8 900
0
Host challenge: E81EAC2B833E5DCF
Card challenge: 00B93785186688F1
Card reports SCP02 with version 255 keys
Master keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:404142434445464748494A4B4C4D4E4F
Sequnce counter: 00B9
Derived session keys:
Version 0
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:1EC5FBCA9A5F21F727C14461A7D7E2C6
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:2688CFFD58CCF9EB52B5D5E786364C89
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:C181FE8094950965495E0D5023AFD65D
Verified card cryptogram: 63331EF41FA02CB8
Calculated host cryptogram: A269860A0E584230
A>> T=1 (4+0016) 84820100 10 A269860A0E5842301E0CBE71E485EA79
A<< (0000+2) (66ms) 9000
A>> T=1 (4+0010) 84F28000 0A 4F00DF01359AC330E966
A<< (0011+2) (46ms) 08A000000151000000019E 9000
A>> T=1 (4+0010) 84F24000 0A 4F003E447E78BC4DE5CC
A<< (0014+2) (45ms) 0B01020304050607080900070700 9000
A>> T=1 (4+0010) 84F22000 0A 4F00D20EAEA9E44363C1
A<< (0018+2) (48ms) 07A000000151535001000501020304050100 9000
A>> T=1 (4+0010) 84F21000 0A 4F003EA1383F26463052
A<< (0020+2) (54ms) 07A000000151535001000108A000000151535041 6310
A>> T=1 (4+0010) 84F21001 0A 4F002196E82C3A537F62
A<< (0000+2) (50ms) 6A88
javax.smartcardio.CardException: Get Status failed, SW: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
SCardEndTransaction()
SCardDisconnect("ACS CCID USB Reader 0", false)
Exception in thread "main" javax.smartcardio.CardException: Get Status failed, S
W: 6A88
at pro.javacard.gp.GlobalPlatform.getConcatenatedStatus(GlobalPlatform.j
ava:1020)
at pro.javacard.gp.GlobalPlatform.getStatus(GlobalPlatform.java:1070)
at pro.javacard.gp.GlobalPlatform.getRegistry(GlobalPlatform.java:673)
at pro.javacard.gp.GPTool.main(GPTool.java:499)
gp:
使用另一张卡进行测试:
我将此包裹上传到另一张卡(另一种类型)上,但是还可以!
I upload this package on another card (another type), but it is OK!
gp: gp -list
AID: A000000003000000 (|........|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
gp: gp -install e:\PackageWithLongAIDs.cap
gp: gp -list
AID: A000000003000000 (|........|)
ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected,
CVM (PIN) management
AID: 0102030405060708090007 (|...........|)
App SELECTABLE: (none)
AID: 0102030405 (|.....|)
Exe LOADED: (none)
gp:
正如您在上面看到的,我的软件包小程序列表未出现在输出中(我认为这是卡的SD的功能),但是我的输出没有任何错误.
As you see above, the list of applets of my package doesn't appear in output(I think it is a feature of SD of my card), but I have output without any error.
我认为卡是错误的根源!不?
I think the card is the origin of the error! No?
请注意,仅当程序包包含超过 20 个小程序时,才会出现此问题.
Note that, This problem appear only in cases that the package contains more than 20 applets.
推荐答案
如果您对特定软件有疑问,请请遵循该软件的文档以获取帮助(包括在正确的位置发布信息)并发布具有足够信息的信息,例如GlobalPlatformPro带有-d -v的日志,如果您认为发现了错误,请打开github问题)
If you have troubles with specific software, please follow the documentation of the software to get help (this includes posting to the right place and posting with sufficient information, like logs with -d -v for GlobalPlatformPro and do open a github issue if you think you have found a bug)
如果您对JavaCard或GlobalPlatform有疑问,请先阅读规格,然后再问规格中解释的问题(例如不同的VM限制)
If you have questions about JavaCard or GlobalPlatform, please read the specifications before asking questions that are explained in the specs (like different VM limitations).
这篇关于Java卡对长AID和短AID小程序的怪异响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!