Hello Folks.
I am trying to get my head around on how java applet loading works for
sysmo-isim-sja2.
At first I used the following, updated example to compile a
HelloSTK2.cap:
https://github.com/mrlnc/HelloSTK2.git
This works fine and it also loads fine on sysmo-usim-sjs2 using shadysim.py
Now I want to load the exact same file to a sysmo-isim-sja2.
I tried with shadysim_isim.py from
https://github.com/herlesupreeth/sim-tools:
---------------8<---------------
$ python shadysim_isim.py --pcsc 2 -l
/home/owner/work/simcard_applet_loading/HelloSTK2.cap -i
/home/owner/work/simcard_applet_loading/HelloSTK2.cap
--enable-sim-toolkit --module-aid d07002ca44900101 --instance-aid
d07002CA44900101 --nonvolatile-memory-required 0100
--volatile-memory-for-install 0100 --max-menu-entry-text 15
--max-menu-entries 05 --kic 56B6B26346DEF2A74BC8DFAF3BEA71D6 --kid
8EFE5A4B60C751FD18F33A24886967E7
Traceback (most recent call last):
File "shadysim_isim.py", line 494, in <module>
ac.load_app(args.load_app)
File "shadysim_isim.py", line 369, in load_app
self.load_aid_raw(aid, data, len(data) / 2)
File "shadysim_isim.py", line 271, in load_aid_raw
self.send_wrapped_apdu_checksw('80e60200' + ('%02x' % (len(data) /
2)) + data + '00c0000000')
File "shadysim_isim.py", line 246, in send_wrapped_apdu_checksw
raise RuntimeError("SW match failed! Expected %s and got %s." %
(sw.lower(), response[1]))
RuntimeError: SW match failed! Expected 9000 and got 6985.
---------------8<---------------
And I also tried with gp.jar from
https://github.com/mrlnc/HelloSTK2.git
---------------8<---------------
$ java -jar ./gp.jar --key-enc 56B6B26346DEF2A74BC8DFAF3BEA71D6
--key-mac 8EFE5A4B60C751FD18F33A24886967E7 --key-dek
3BA47E883FE2462B5D43B85C4CCDF0AC --install
/home/owner/work/simcard_applet_loading/HelloSTK2.cap
[main] WARN pro.javacard.gp.PlaintextKeys - Don't know how to calculate
KCV, defaulting to SCP02
[main] WARN pro.javacard.gp.PlaintextKeys - Don't know how to calculate
KCV, defaulting to SCP02
[main] WARN pro.javacard.gp.PlaintextKeys - Don't know how to calculate
KCV, defaulting to SCP02
[main] INFO pro.javacard.gp.GPSession - Using card master keys:
ENC=56B6B26346DEF2A74BC8DFAF3BEA71D6 (KCV: 1ADB2F)
MAC=8EFE5A4B60C751FD18F33A24886967E7 (KCV: 174546)
DEK=3BA47E883FE2462B5D43B85C4CCDF0AC (KCV: D7011A) for null
[main] INFO pro.javacard.gp.GPSession - Diversified card keys:
ENC=56B6B26346DEF2A74BC8DFAF3BEA71D6 (KCV: 1ADB2F)
MAC=8EFE5A4B60C751FD18F33A24886967E7 (KCV: 174546)
DEK=3BA47E883FE2462B5D43B85C4CCDF0AC (KCV: D7011A) for SCP02
[main] INFO pro.javacard.gp.GPSession - Session keys:
ENC=76900ED8B816F1822A29D7DC81F1B843
MAC=02D74CFFA5F85F1F999F23F60C22AF02
RMAC=87AFE7F26DDE69307EA35AE567AC8F26, card
keys=ENC=56B6B26346DEF2A74BC8DFAF3BEA71D6 (KCV: 1ADB2F)
MAC=8EFE5A4B60C751FD18F33A24886967E7 (KCV: 174546)
DEK=3BA47E883FE2462B5D43B85C4CCDF0AC (KCV: D7011A) for SCP02
CAP loaded
Error: INSTALL [for install and make selectable] failed: 0x6A80 (Wrong
data/incorrect values in data)
---------------8<---------------
As it seems gp.jar seems to work better than shadysim_isim.py.
Unfortunately I have no experience in java card programming yet, so its
difficult for me to tell where the error could be.
(When I run gp.jar once more it tells me "Error: STRICT WARNING: Package
with AID D07002CA44 is already present on card", I can also delete the
applet again, so apparently its kind of loaded...)
Is there anyone here who managed to load an applet to a sysmo-isim-sja2
and how?
best regards.
Philipp
--
Philipp Maier <pmaier(a)sysmocom.de>
http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte