Project

General

Profile

Actions

Bug #5575

closed

PySim Shell - Change OPC value

Added by Royman almost 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
06/01/2022
Due date:
% Done:

100%

Spec Reference:

Description

Dear PySim Team,

either my Syntax is wrong, or the Json Path function is not working correctly for changing the K, OP and OPC values in the USIM_AUTH_KEY folder. If possible, please give me a hint what the correct syntax would look like, I tried multiple syntax' that only produced exception errors.

I tried the JSON Path example from the readme.MD (target: OFM), that is working just fine for me, but it is a boolean value and therefore the syntax is not 100% applicable to the OPC which looks like a string value.

I'm looking forward to hearing from you.

Kind regards,
Christoph Reimann

Card used: SysmocomSJA2
Card Reader: Omnikey CardMan 3121 USB CCID interface
OS: Debian 64 bit

Commands:

user@debian:~/pysim$ ./pySim-shell.py -p0
Using PC/SC reader interface
Waiting for card...
Autodetected card type: sysmoISIM-SJA2
Info: Card is of type: UICC-SIM
AIDs on card:
USIM: a0000000871002ffffffff8907090000 (EF.DIR)
ISIM: a0000000871004ffffffff8907090000 (EF.DIR)
ARA-M: a00000015141434c00
ADF.ISD: a000000003000000
Detected CardModel: SysmocomSJA2
Welcome to pySim-shell!
pySIM-shell (MF)> verify_adm 72523357
pySIM-shell (MF)> select ADF.USIM 
{
"file_descriptor": {
"file_descriptor_byte": {
"shareable": true,
"file_type": "df",
"structure": "no_info_given" 
},
"record_len": null,
"num_of_rec": null
},
"df_name": "a0000000871002ffffffff8907090000",
"proprietary_information": {
"uicc_characteristics": "71",
"available_memory": 96936
},
"life_cycle_status_integer": "operational_activated",
"security_attrib_compact": "00",
"pin_status_template_do": {
"ps_do": "70",
"key_reference": 11
}
}
pySIM-shell (MF/ADF.USIM)> select EF.USIM_AUTH_KEY
{
"file_descriptor": {
"file_descriptor_byte": {
"shareable": true,
"file_type": "working_ef",
"structure": "transparent" 
},
"record_len": null,
"num_of_rec": null
},
"file_identifier": "af20",
"proprietary_information": {
"unknown_ber_tlv_ie_d0": {
"raw": "30" 
}
},
"life_cycle_status_integer": "operational_activated",
"security_attrib_compact": "031a1a",
"file_size": 33,
"short_file_identifier": null
}
pySIM-shell (MF/ADF.USIM/EF.USIM_AUTH_KEY)> read_binary_decoded 
{
"cfg": {
"only_4bytes_res_in_3g": 0,
"use_sres_deriv_func_2_in_3g": 0,
"use_opc_instead_of_op": 1,
"algorithm": "milenage" 
},
"key": "228b74faa1d93a938f2e44789bc4f3aa",
"op": null,
"opc": "55e6b31c4e1ffae3b433736392c1dd83" 
}
pySIM-shell (MF/ADF.USIM/EF.USIM_AUTH_KEY)> update_binary_decoded --json-path opc "55e6b31c4e1ffae3b433736392c1dd83" 
EXCEPTION of type 'JSONDecodeError' occurred with message: 'Extra data: line 1 column 5 (char 4)'
To enable full traceback, run the following command: 'set debug true'
pySIM-shell (MF/ADF.USIM/EF.USIM_AUTH_KEY)> update_binary_decoded --json-path opc 55e6b31c4e1ffae3b433736392c1dd83
EXCEPTION of type 'JSONDecodeError' occurred with message: 'Extra data: line 1 column 5 (char 4)'
To enable full traceback, run the following command: 'set debug true'
pySIM-shell (MF/ADF.USIM/EF.USIM_AUTH_KEY)> update_binary_decoded --json-path "opc": "55e6b31c4e1ffae3b433736392c1dd83" 
usage: update_binary_decoded [-h] [--json-path JSON_PATH] data
update_binary_decoded: error: unrecognized arguments: 55e6b31c4e1ffae3b433736392c1dd83
pySIM-shell (MF/ADF.USIM/EF.USIM_AUTH_KEY)> update_binary_decoded '{"opc": "55e6b31c4e1ffae3b433736392c1dd83"}'
EXCEPTION of type 'KeyError' occurred with message: ''cfg''
To enable full traceback, run the following command: 'set debug true'
pySIM-shell (MF/ADF.USIM/EF.USIM_AUTH_KEY)> 


Files

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)