问题
I create a package that contains 22 equal applets.(The applets are equal in program and different in AID.)
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)
Package AID = 0102030405
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
Look :
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:
Now,I change I change the AID of Applets as below (everything else is the same as for before) :
Package AID = 0102030405
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:
Why?!
Update :
Debug Mode - Short AIDs :
.
.
.
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:
Debug Mode - Long AIDs :
.
.
.
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:
Test with another Card :
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:
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?
Note that, This problem appear only in cases that the package contains more than 20 applets.
回答1:
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)
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).
来源:https://stackoverflow.com/questions/28512945/java-card-weird-response-to-long-aid-and-short-aid-applets