Hello, I’m trying to load an app into a sysmoISIM-SJA2 using pySim and a card reader. What is the range of things that could return a SW1-2 = 6985 during the load step (#2)? I’m guessing it’s permissions or dependencies but I don’t know how that kind of issue is making it through step #1.
Using reader PCSC[HID Global OMNIKEY 3x21 Smart Card Reader 0]
Waiting for card...
Info: Card is of type: UICC
Detected UICC Add-on "SIM"
Detected UICC Add-on "RUIM"
AIDs on card:
USIM: a0000000871002ffffffff8907090000 (EF.DIR)
ISIM: a0000000871004ffffffff8907090000 (EF.DIR)
ADF.ISD: a000000003000000
ARA-M: a00000015141434c00
Detected CardModel: SysmocomSJA2
Welcome to pySim-shell!
(C) 2021-2023 by Harald Welte, sysmocom - s.f.m.c. GmbH and contributors
Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/shell.html
verify_adm 97924919
select ADF.ISD
{
"application_id": "a000000003000000",
"proprietary_data": {
"maximum_length_of_data_field_in_command_message": 255
}
}
establish_scp02 --key-dek 36FA9B3864E3ED03427425928316728E --key-enc D9406145752E36C100CCE094236223B3 --key-mac FB2D263E234036ABDBCB7F810ACFFC1C --security-level 1
Successfully established a SCP02[01] secure channel
set debug true
debug - was: False
now: True
set apdu_trace true
apdu_trace - was: False
now: True
install_cap TestApp.cap --install-parameters-non-volatile-memory-quota 255 --install-parameters-volatile-memory-quota 255 --install-parameters-stk 010001001505000000000000000000000000
loading cap file: TestApp.cap ...
parameters:
security-domain-aid: a000000003000000
load-file: 2386 bytes
load-file-aid: a000000003
module-aid: a00000000300ffff20230709
application-aid: a00000000300ffff20230709
install-parameters: c900ef1cc80200ffc70200ffca12010001001505000000000000000000000000
step #1: install for load...
-> 84e602001a 05a00000000308a000000003000000000000aad7bd59f5d6ab3800
<- 9000: 00
step #2: load...
-> 84e80000f8 c482095201000fdecaffed010204000105a00000000302001f000f001f0010004e00be0025054100170099000001d400020001000a05010004004e05020107a00000006201010c0110a0000000090005ffffffff8912000000020110a0000000090005ffffffff8913000000020110a0000000090005ffffffff8911000000000107a0000000620001030010010ca00000000300ffff20230709052c06002542800303000307050000003b0035003803f703fa8002008108010940000000ff000c00000007054102019f800701a800070231800e0241001f0510188c0003181064900b870018100e048d00068701188f2684ad66648df15000
<- 6985:
Traceback (most recent call last):
File "C:\Users\MHAYES\PyCharmProjects\pysim1\.venv\Lib\site-packages\cmd2\cmd2.py", line 2552, in onecmd_plus_hooks
stop = self.onecmd(statement, add_to_history=add_to_history)
File "C:\Users\MHAYES\PyCharmProjects\pysim1\.venv\Lib\site-packages\cmd2\cmd2.py", line 3031, in onecmd
stop = func(statement)
File "C:\Users\MHAYES\PyCharmProjects\pysim1\.venv\Lib\site-packages\cmd2\decorators.py", line 392, in cmd_wrapper
return func(*args_list, **kwargs) # type: ignore[call-arg]
File "C:\Users\MHAYES\PyCharmProjects\pysim1\pySim\global_platform\__init__.py", line 908, in do_install_cap
self.load(load_file)
~~~~~~~~~^^^^^^^^^^^
File "C:\Users\MHAYES\PyCharmProjects\pysim1\pySim\global_platform\__init__.py", line 859, in load
_rsp_hex, _sw = self._cmd.lchan.scc.send_apdu_checksw(cmd_hex)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\Users\MHAYES\PyCharmProjects\pysim1\pySim\commands.py", line 124, in send_apdu_checksw
return self.scp.send_apdu_wrapper(self._tp.send_apdu_checksw, pdu, sw)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MHAYES\PyCharmProjects\pysim1\pySim\secure_channel.py", line 37, in send_apdu_wrapper
res, sw = send_fn(pdu_wrapped, *args, **kwargs)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MHAYES\PyCharmProjects\pysim1\pySim\transport\__init__.py", line 244, in send_apdu_checksw
raise SwMatchError(rv[1], sw.lower(), self.sw_interpreter)
pySim.exceptions.SwMatchError: SW match failed! Expected 9000 and got 6985: Command not allowed - Conditions of use not satisfied
EXCEPTION of type 'SwMatchError' occurred with message: SW match failed! Expected 9000 and got 6985: Command not allowed - Conditions of use not satisfied