Open jo-bitsch opened 1 year ago
This seems to also be related to #308
technically saveDGI should always have the 0x08 bit set (at least according to the spec), as it always saves DGI data (hence the name), but with the --store-p1
patch (#308) we could as a work around also save the prepersonalization data using --store-p1 0x88 --store-data 9F67081111111111111111
which I guess is ever so slightly better than sending the raw APDU via SCP using -s
though that could be open to discussion.
What's completely open to me, is, if other cards might misbehave if you are using P1=0x88 (which is at least to the current spec) vs if you are using P1=0x80 (which is the current behavior of gp.jar and presumably extensively tested with other cards)
Ideally I'd like to keep command line options reusable (#308). I doubt the command was heavily tested with many cards, so diffing specs and testing with a wider variety of cards is needed for this specific issue.
First: Thanks for this really excellent tool! I really appreciate your work!
Describe the bug
Storing the PrePersonalization and Personalization Information running
--set-pre-perso
fails with6A80 (Wrong data/incorrect values in data)
Checking with the GlobalPlatform Specification(https://globalplatform.org/wp-content/uploads/2018/05/GPC_CardSpecification_v2.3.1_PublicRelease_CC.pdf page 197, Table 11-89), the APDU for setting the information should be
84E288000b9F67081111111111111111
, instead of84E280000b9F67081111111111111111
the difference beingP1=0x88
vs.P1=0x80
, which is set in saveDGI(https://github.com/martinpaljak/GlobalPlatformPro/blob/c03e87987227e045d5a28352bb19a5895aed4dc8/library/src/main/java/pro/javacard/gp/GPCommands.java#L42)P1 = 0x80 /*last block*/ | 0x08 /*DGI format of the command data field*/; // --> 0x88
Sending the corrected APDU by hand results in the expected behavior of the card setting the prepersonalization data.
Unfortunately, I don't have other cards available to check if this works on other cards as well.
Information about your card
As much information as you have:
Vendor Infineon
Product Secora ID S / SLJ 52GxxyyyzS
Version 1.00
Expected behavior
The card should save the prepersonalization data and return
9000
instead of6A80
, like soand store the prepersonalization data accordingly, which it does with the corrected P1.
Full log of erroneous behavior