-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 6F00 on NXP JCOP3 J3H082 Java Card 3.0.4 Dual-Interface (Cardlogix) #46
Comments
I think this card is a bit low on available memory. If you do not plan to attach X509 certificates to your keys, you can reduce the amount of reserved memory for them; see the second item about |
Thanks for your help! The output of 'gp -list' is below. I am trying recompilation with changes to Constants.EXTENDED_CAPABILITIES
|
I made the changes to Constants.EXTENDED_CAPABILITIES and tried installation after recompile, but I still get the same error:
|
This card already has several loaded packages. |
You can make a small applet to query available EEPROM sizes (or use JCOP proprietary APDU-s for that). Without knowing anything about the card or what is supposed to be on it, I'd remove everything except the SSD creation packages for development purposes. But do ask the card vendor first.
|
Thank you @martinpaljak ! |
Thanks for your help. My question about which applets can be removed to the vendor did not elicit any response. Muddling through myself like a noob, I was able to use
The remaining applets cannot be deleted (checked using trial and error). In response to another query, the vendor replied to me saying:
In response to this, I tried a pre-built SmartPGP-v1.22.1-jc304-without_sm-rsa_up_to_2048.cap file from this url. Installation of that applet also gave me the error below:
In further noob-like experimentation, I modified
All in all, I am feeling out of my depth in this technology, with very limited knowledge of JCOP, smart card applets etc. I have been left with 10 J3H082 cards which are looking like expensive paperweights! I had buy 10, because that was the minimum order quantity. Not supporting RSA4096 is not an issue for me - I primarily wanted to use ECC NIST P-256, but just installing and getting the card recognized by gpg has proved to be a very high obstacle for me. I am open to any suggestions / things to explore. |
You can check the available memory on your card using a test applet I have created. Instructions of installation and use are included in this repo. Delete ALL applets that can be deleted first including the SmartPGP applet. Install this applet and run it to get the memory sizes of your cards and then you may install the SmartPGP applet afterwards. Optionally, you may want to delete this applet before installing SmartPGP to squeeze out as much userspace memory on card but I doubt it matters as this applet I created is really small. |
@thotheolh Thank you!
The memory result was
The sizes seem to be too LARGE? Card is supposed to have 80K bytes user memory. |
@thotheolh |
This is your correct result from your above output:
Your card memory is 00008184 <--- Persistent Memory (EEPROM) is 33156 bytes Your RAM memory is very low (960 bytes). Did you delete the SmartPGP applet before running my MemTest applet ? Can you do a |
This is simply the select card manager APDU and not the MemTest result. You should pick out the 0000000000 00 pattern for the MemTest result as shown below:
|
Sorry for the elementary mistake. The output of
|
Running
Installing your applet and running the APDU you provided on that card where no applets have been deleted gives:
Interpreting the result compared to previous resule after deleting applets: After deleting apps:
Without deleting apps:
|
Also I note that your card is in INITIALIZED mode ... this is very usual. I also have a card I purchased from CardLogix too but mine is the JCOP4 J3R110 variant for development which is a different NXP JavaCard model.
You will notice that it's in OP_READY state instead of INITIALIZED state. Of course you could still upload applets in INITIALIZED state ... but this is very odd and for a developer card, it should typically be in OP_READY instead. Not sure what happened. In regards to RAM size, 900+ bytes of RAM is simply insufficient for SmartPGP from my experience using them. In essence, after deleting all the applets that can be deleted you get 900++ bytes RAM ??? and without deleting any applets that was purchased you also have 900++ bytes of RAM, this isn't very ideal. I wonder if SmartPGP can shrink down the sizes. Also look inside the Constants class. It has That means its already requesting for 1280 bytes and on top of that it still wants and it wants 5x of SHORT types (~ 10 bytes), 5x BOOLEANS (~ 5 bytes), 4 additional BYTES types (~ 4 bytes). This is not accurate calculation because there are other assignments of variables not counted. You effectively should require a safe amount around 2000 bytes or more just to be safe at least. Hopefully a variant of SmartPGP with ECC_P256 + RSA_2048 - Secure_Messaging and a shrinked down footprint could be available otherwise just 900+ bytes of RAM is unusable. |
Regarding OP_READY state, I saw the following in Global Platform Pro TestedCards. NOTICE: a JavaCard shall be listed here as "supported" if and only if:
Not knowing a lot about this field, I specifically confirmed with Cardlogix before I bought the cards that the cards would come with the default keys and in OP_READY state. What exactly is the difference between |
Certain pre-personalization steps are not possible in INITIALIZED state. From simple JavaCard application POV you should see no difference. |
Thanks @martinpaljak The J3H082’s we sent you only support up to RSA 2048-bit, the chip is capable of supporting up to 4096-bit but is not default and has to be enabled during pre-personalization. The reason that RSA 2048-bit is the default setting is because enabling 4096 uses up extra HEAP memory. Unfortunately, all of our J3H082’s we have on the shelf have already been pre-personalized and 4096 can’t be enabled. |
Sure, there are different phases of the "pre-personalization" buzzword - chip/"firmware" level (what nxp/cardlogix does) and "logical" global platform level (which you can do yourself). Your question now is why the 2k rsa applet does not install. Some googling tells me A0000003965454000000010101 is desfire emulation, which would eat everything on the chip. Have you deleted it? Not sure if the logical deletion of related applets removes the underlying chip configuration tho. |
I was unable to delete that applet. I get the following error message:
|
What if trying to delete A000000396545400000001 ? |
Cannot delete any of the remaining applets:
|
@sundarnagarajan can you add |
java -jar gpp/gp.jar --delete A0000001515350 |
A0000003965454000000010101 is some NXP package, that I suspect but can't confirm is related to Mifare. Can you ask your card vendor for a new card, without any NXP add-ons? |
@thotheolh
Trying to delete A000000396545400000001 with --verbose --debug:
Trying to delete A0000003965454000000010101 with --verbose --debug
|
I am trying to do this. Hopefully should get replacement cards by Friday. |
Thank you for your help. Good news: I received replacement cards yesterday. The new cards are Cardlogix NXP JCOP 4 Java Card 3.0.5 Classic J3R180. gpg sees the card, and I was able to generate RSA4096 keys on the card and use them. I could also generate and use NIST P-384 keys on the card and use them. For generating NIST P-521 keys on the card, I needed this patch and the following patch to set
I used branch I also learned how to set the manufacturer ID and card-specific serial number in the AID by editing build.xml - setting Recompiling the SmartPGP applet with these patches, I was able to:
The manufacturer ( Thank you for all your help ! Output from pcsc_scan:
Output of
Output of
Output from memtest applet:
I have run jcalgtest and I have the results of the ALGSUPPORT test. |
Good news! |
Everything is OK. The issue can be closed. |
Please note there is an ongoing issue (47) with SmartPGP on J3R180 when KDF setup is used. |
I have a NXP JCOP3 J3H082 Java Card 3.0.4 Dual-Interface card from Cardlogix.
I am trying using Global Platform Pro compiled from source.
Operating environment:
I have compiled SmartPGPApplet.cap using JCDK 3.0.4 from oracle_javacard_sdks
When I try to install SmartPGPApplet.cap using the command
```java -jar gpp/gp.jar -v --install applets/SmartPGPApplet.cap``
I get the following error:
What have I tried:
All the above cases gave the same error
Any help is appreciated.
The text was updated successfully, but these errors were encountered: