commit | 082d4e095688df3cbbb8675e4bf4bdade6a28d14 | [log] [tgz] |
---|---|---|
author | Harald Welte <laforge@osmocom.org> | Fri Apr 02 20:59:05 2021 +0200 |
committer | Harald Welte <laforge@osmocom.org> | Fri Apr 02 21:01:39 2021 +0200 |
tree | 034267d95a8282b7019b3c3a75c3c0539a53df95 | |
parent | ac34dcc149ebd41d81b6954b805f9d09f3e56a8b [diff] |
ts_31_102: Fix decode_select_response() for DF.5GS In Change-Id I848a766e6d00be497c7db905475e0681cce197ac we added a CardDF instance for DF_5GS. That DF should not have provided a decode_select_response() method, and instead fall back to that of the base class, which calls the method of the parent directory (ADF_USIM). The difference is illustrated below pySIM-shell (MF/ADF.USIM/EF.IMSI)> select DF.5GS "622e8202782183025fc0a509800171830400018d088a01058c056611111111c60f90017083010183018183010a83010b" vs. (with this patch): pySIM-shell (MF/ADF.USIM)> select DF.5GS { "file_descriptor": { "shareable": true, "file_type": "df", "structure": "no_info_given" }, "file_identifier": "5FC0", "proprietary_info": { "uicc_characteristics": "71", "available_memory": 101640 }, "life_cycle_status_int": "operational_activated", "security_attrib_compact": "6611111111", "pin_status_template_do": "90017083010183018183010A83010B" } Change-Id: I80612711bbc8c47285a828a0759b20beea6619f1
This repository contains a Python-language program that can be used to program (write) certain fields/parameters on so-called programmable SIM/USIM cards.
Such SIM/USIM cards are special cards, which - unlike those issued by regular commercial operators - come with the kind of keys that allow you to write the files/fields that normally only an operator can program.
This is useful particularly if you are running your own cellular network, and want to issue your own SIM/USIM cards for that network.
The official homepage of the project is http://osmocom.org/projects/pysim/wiki
You can clone from the official libosmocore.git repository using
git clone git://git.osmocom.org/pysim.git
There is a cgit interface at http://git.osmocom.org/pysim/
pysim requires:
Example for Debian:
apt-get install python3-pyscard python3-serial python3-cmd2 python3-pip python3-yaml pip3 install pytlv
Alternatively, everything can be installed using pip:
pip3 install -r requirements.txt
There is no separate mailing list for this project. However, discussions related to pysim-prog are happening on the openbsc@lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/openbsc for subscription options and the list archive.
Please observe the Osmocom Mailing List Rules when posting.
Our coding standards are described at https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
We are currently accepting patches by e-mail to the above-mentioned mailing list.
./pySim-prog.py -n 26C3 -c 49 -x 262 -y 42 -i -s
./pySim-prog.py -n 26C3 -c 49 -x 262 -y 42 -z <random_string_of_choice> -j <card_num>
With <random_string_of_choice> and <card_num>, the soft will generate 'predictable' IMSI and ICCID, so make sure you choose them so as not to conflict with anyone. (for eg. your name as <random_string_of_choice> and 0 1 2 ... for <card num>).
You also need to enter some parameters to select the device : -t TYPE : type of card (supersim, magicsim, fakemagicsim or try 'auto') -d DEV : Serial port device (default /dev/ttyUSB0) -b BAUD : Baudrate (default 9600)
from pySim.transport.serial import SerialSimLink from pySim.commands import SimCardCommands
sl = SerialSimLink(device='/dev/ttyUSB0', baudrate=9600) sc = SimCardCommands(sl)
sl.wait_for_card()
# Print IMSI
print(sc.read_binary(['3f00', '7f20', '6f07']))
# Run A3/A8
print(sc.run_gsm('00112233445566778899aabbccddeeff'))