Open bob-613 opened 3 years ago
gp
, but I would assume that in the mode a master key is used and the 3 keys are derived from it for the secure channel. It should be possible to specify the master key, otherwise maybe also 4041... is used. The derivation is useful because then just the public key diversification data is needed for calculating the keys and it is not necessary to store for all cards the keys anymore.gp
, but this looks strange, it should then also use the emv mode.gp
can authenticate.You cannot call get_status -element e0
before the authentication.
But actually I do not see that gp
is using derivation. Use:
mode_211
enable_trace
enable_timer
establish_context
card_connect
select -AID a0000000030000
open_sc -security 1 -scp 2 -keyind 0 -keyver 1 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f
card_disconnect
release_context
Give this a try with key derivation:
mode_211
enable_trace
establish_context
card_connect
select -AID a000000003000000
open_sc -security 1 -keyind 0 -keyver 0 -key 404142434445464748494a4b4c4d4e4f -keyDerivation emvcps11
card_disconnect
release_context
The options for the key derivation are here: https://github.com/kaoh/globalplatform/blob/master/gpshell/src/gpshell.1.md#key-derivation.
BTW. You can also use a script file, instead of typing it in like referenced in the description in https://github.com/kaoh/globalplatform/blob/master/gpshell/src/gpshell.1.md, e.g. https://github.com/kaoh/globalplatform/blob/master/gpshell/helloInstallGP211.txt
Wow! thanks you VERY much! What solve the issue is just using mode_211
(I dont need -scp 2
)
But I'm still not able to list apps, or install apps. Very strange.
Install applet:
install -file helloworld.cap
install_for_load() returns 0x80206A88 (6A88: Referenced data not found.)
List applets:
get_status -element e0
get_status() returns 0x80206A86 (6A86: Incorrect parameters (P1, P2).)
Can you please provide the full APDU log again for both scripts (list applets + install applet)? The enable_trace
does this. Then I can dissemble the sent data.
Do you have any updates regarding this?
@bob-613 : Can you please provide the full APDU log again for both scripts (list applets + install applet)? The enable_trace does this. Then I can dissemble the sent data.
I have tried to list and install apps using GP Pro, but it didn't work (https://stackoverflow.com/questions/68087131/cannot-list-or-install-cap-files-in-javacard-after-unlocking-why-and-how-to-so) so I tried GP, but it also not working
I tried the sample. but not working
Also this not working:
Some more info that may help:
I'm trying to understand. (I didn't found a spec to it ( emvco.com/specifications.aspx?id=20 ))
Also I'm trying to understand:
gp -emv -unlock
what is it doing? No I only need keys and it is not emv any more?-emv
later (when doinggp -l -emv
it's falied)What are the keys here (https://community.oracle.com/tech/developers/discussion/2258766/gpshell-command-for-smart-cafe-expert-3-2) Do I need to specify it somewhere?