Closed elipsion closed 1 week ago
CAP file (v2.1), contains: applets for JavaCard 3.0.4/GlobalPlatform unknown: 1.7
Where do you get the export files of GlobalPlatform with such version?Please explain which error message would you like to get changed (and if possible, run sample logs "next" branch)
Ah, look at that. It's only visible in the verbose output, and not indicative of whether the card will accept the software or not. I just downloaded the most recent version from their webpage, since I hadn't found your repository yet.
I wonder if the supported frameworks can be gleaned from the package list on the card:
PS C:\source\repos\IsoApplet> java -jar gp.jar -r "ACS APG8201-B2 0" -l -v
GlobalPlatformPro v20.01.23-0-g5ad373b
Running on Windows 10 10.0 amd64, Java 11.0.8 by AdoptOpenJDK
Reader: ACS APG8201-B2 0
ATR: 3BDC18FF8191FE1FC38073C821136605036351000250
More information about your card:
http://smartcard-atr.appspot.com/parse?ATR=3BDC18FF8191FE1FC38073C821136605036351000250
[DEBUG] GPSession - Auto-detected ISD: A000000151000000
Warning: no keys given, using default test key 404142434445464748494A4B4C4D4E4F
[WARN] PlaintextKeys - Don't know how to calculate KCV, defaulting to SCP02
[WARN] PlaintextKeys - Don't know how to calculate KCV, defaulting to SCP02
[WARN] PlaintextKeys - Don't know how to calculate KCV, defaulting to SCP02
[INFO] GPSession - Using card master keys: ENC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) MAC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) DEK=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) for null
[DEBUG] GPSession - Host challenge: E7950C0AC481846A
[DEBUG] GPSession - Card challenge: 0016817262FE5F90
[DEBUG] GPSession - Card reports SCP02 with key version 255 (0xFF)
[INFO] GPSession - Diversified card keys: ENC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) MAC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) DEK=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) for SCP02
[INFO] GPSession - Session keys: ENC=77A3C15AB440E2651B32577DB6C27505 MAC=303BB82519C6D717D86F391C506F852F RMAC=736B318928C93BEFAA58DCC4411D6142, card keys=ENC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) MAC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) DEK=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) for SCP02
[DEBUG] GPSession - Verified card cryptogram: 63C239DCD28DCAE6
[DEBUG] GPSession - Calculated host cryptogram: 541D0829CF0EE947
[DEBUG] GPRegistry - Registry already contains PKG: A0000001515350, 1
ISD: A000000151000000 (SECURED)
Parent: A000000151000000
From: A0000000620001
Privs: SecurityDomain, CardLock, CardTerminate, CardReset, CVMManagement, TrustedPath, AuthorizedManagement, TokenVerification, GlobalDelete, GlobalLock, GlobalRegistry, FinalApplication, ReceiptGeneration
PKG: A0000001515350 (LOADED) (|....QSP|)
Applet: A000000151535041 (|....QSPA|)
PS C:\source\repos\IsoApplet>
In this case the error (probably) was the card rejecting a too recent library, but I don't know how specific the error code is and therefore not sure about how specific the associated message should be (Unsupported plattform version vs. Card no like package). But something about the software being actively rejected is probably a good start.
I don't have any strong feelings in the matter; and since the error is proprietary I can totally agree that it's outside of the scope for this project to have a pretty textual waring for it.
From a UI/UX perspective; the error message could be clearer about that the error (in this case 0x6438
) is something that was given to gp
from the card/underlying driver stack, rather than something emitted from within gp
itself.
That sw-s come from the device should be prior knowledge of anyone working with gp. But working on the ux to make such messages clearer and better positioned would probably not hurt. Suggestions as CLI mockups would help!
I consider this specific issue fixed by 338e53b9c1a87c655ec38d561aab7aa30a5e2992
Describe the bug
When trying to load an applet built with a too recent version of GlobalPlatform,
gp
produces a less-than-stellar error message.Information about your card
https://www.cardlogix.com/product/nxp-jcop3-j2h145-java-card-145k/
Expected behavior
Unsupported Framework
Full log
Using GPv1.7
Using GPv1.5 (aka 2.2.1)
Additional context
Full APDU-dump available upon request :)