aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-prog.py
AgeCommit message (Collapse)AuthorFilesLines
2019-08-28Add an option to read the iccid and batch-program the new card datausers/daniel/csv-formatDaniel Willmann1-5/+16
This can be used to reprogram everything including IMSI on the card: while true; do ./pySim-prog.py -p 0 -t sysmoUSIM-SJS1 --source=csv --read-csv=cards.csv --read-iccid && paplay complete.oga sleep 2 done Change-Id: Ib343a29141b5255f67a59ab76959b51e162b7916
2019-08-28pySim-prog: Use CSV format with headersDaniel Willmann1-8/+16
This way we can have optional fields like adm1 in the file Also require iccid as identifier for the SIM card Change-Id: I0d317ea51d0cf582b82157eec6cdec074001a236
2019-05-10pySim-*.py: print info about selected reader interfaceVadim Yanitskiy1-0/+6
Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
2018-10-29pySim-*.py: add command line option for Calypso readerVadim Yanitskiy1-0/+7
Change-Id: Ia895ced62d29e06ae8af05cd95c9d181fb53b9df
2018-10-29pySim-*.py: refactor card reader driver initializationVadim Yanitskiy1-5/+5
This would facilitate adding new card reader drivers. Change-Id: Ia893537786c95a6aab3a51fb1ba7169023d5ef97
2018-10-05pySim-prog: Honor international '+' in SMSC numberDaniel Willmann1-3/+8
The smsc no. programmed by pySim-prog would always be a national number in the past. Check whether the first 'digit' is a + and indicate that it is an international number. Change-Id: Ia79913f5b0307e9786a5acea75c0811927be2eef
2018-07-04pysim-prog: add commandline option to probe cardsPhilipp Maier1-2/+13
In some situations it may be helpful to know the card name (type) we deal with in advance. So lets ad an to probe that only detects the card and then exists. - Add commandline option -T --probe Change-Id: I57422d3819d52fd215ac8f13f890729aad2af76f Related: OS#3376
2018-07-03csv: fix missing import (broken CSV support)Philipp Maier1-1/+1
with Change I38f5d36d16b41b5d516a6a3e2ec1d09637883932, new constants for file identifiers were introduced. When csv file input is used, then pySim-prog.py uses one of these constans without importing it from ts_51_011.py - Add missing import Change-Id: Ic5b067b16ec204c2ba2264b1ffb48d37be8d5eb3
2018-06-13pysim-prog: also allow raw hex adm pins besides numeric asciiPhilipp Maier1-4/+7
At the momemnt pysim takes the supplied ADM pin number and interprets it as ascii string. This ascii string (max 8 digitis) is then padded with 0xff bytes if necessary and sent to the card. This limits the range of possible ADM keys and it is not possible to deal with situataions where the ADM pin consists of arbitrary bytes. At the momemnt pysim-prog forbis anything that is longer than 8 digits. Lets also check if there are 16 digits and if yes interpret them as raw bytes. - when the adm pin is 16 digits long, interpret the string as raw bytes (hex). Change-Id: If0ac0d328c64b57bc4d45d985a4a516930053344 Related: SYS#4245
2018-04-26add support for open cells SIM cardsTodd Neal1-2/+2
Change-Id: I4df5681952eefd7a67f5e2b0a96a9e01c9d960d2
2018-01-23Revert "pySim-prog: ADM code can be longer 8 digits, it's implementation ↵Harald Welte1-3/+4
specific." This reverts commit a51592e1807c1d13f88b32275aa4a8a77d7d3b40, which broke the use of ADM pins on sysmoUSIM-SJS1 (and possibly others?) The ADM pins have so far always been specified as ASCII decimal digits, i.e. something like "-a 53204025" gets translated to hex "3533323034303235" After the above patch this is broken and gets instead translated to "53204025ffffffff" in hex which obviously breaks. Let's revert back to the old behavior to make it work again. Change-Id: I3d68b7e09938a2fcb7a9a6a31048388cc3141f79
2018-01-11Make derive_milenage_opc and calculate_luhn publicly available through utils.pyAlexander Chemeris1-19/+1
Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01
2018-01-10pySim-prog: Replace magic numbers with a readable EF file name.Alexander Chemeris1-1/+1
Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af
2018-01-10pySim-prog: ADM code can be longer 8 digits, it's implementation specific.Alexander Chemeris1-4/+3
E.g. Fairwaves SIM cards have longer ADM codes. Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b
2018-01-10Fix comment: Ki -> OPCAlexander Chemeris1-1/+1
Change-Id: I566cf7bc658c730b4381c0f145bfc4f805cca42a
2017-12-29pySim-prog.py: Fix trailing whitespacePau Espin Pedrol1-1/+0
Change-Id: I735dc7bb774d77d3b60b1712b0f0afcbb81dc726
2017-12-29pySim-*.py: Set shebang to use python v2Pau Espin Pedrol1-1/+1
Nowadays bin/python usually points to python3, and this script is written in python2, which means if run directly from terminal it will fail with some print syntax errors. Change-Id: I6ab4e9edc44a8045915d4828c6de2fa98027fb7e
2016-05-22re-program: Instead of specifying the IMSI, read it from the card.Holger Hans Peter Freyther1-6/+16
2015-08-20Add PIN-ADM argument to the command lineJan Balke1-1/+13
Allow overwriting the default PIN-ADM set in the card implementation.
2015-08-20Introduce a '--dry-run' option to skip actual card accessHarald Welte1-21/+31
This can be used for example to batch convert from CSV input to HLR output without writing cards.
2015-08-20read_params_csv: Make sure we don't end up in endless loopHarald Welte1-7/+13
as a side effect, the first line is now specified with '-j 0' and not '-j 1'
2015-08-20pySim-prog: Add mode where it can re-generate a card from CSVHarald Welte1-5/+54
Rather than just having the capability of writing to CSV, it now has the capability to (re)write a card based on data from the CSV: ./pySim-prog.py -S csv --read-csv /tmp/sim.csv -i 901701234567890 or in batch mode (from the first line onwards): ./pySim-prog.py -S csv --read-csv /tmp/sim.csv --batch -j 1
2015-08-20split parameter writing for CSV and SQL into separate functionsHarald Welte1-2/+7
2013-07-02Implement setting of EF.ACC file in GrcardSim and _MagicSimBaseAlexander Chemeris1-0/+16
From: Alexander Chemeris <Alexander.Chemeris@gmail.com> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-22usim/opc: Derive OPC from KI and OPHolger Hans Peter Freyther1-1/+18
2012-03-22usim/opc: Add support to write completely random OPCHarald Welte1-1/+17
Allow to set the OPC, write it out to the state, generate it randomly.
2011-12-10pySim-prog: Fix SMSC 'number type' field to 0x81Sylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-12-08Fix computation of SMSP from a SMSC numberSylvain Munaut1-5/+30
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-12-08Whitespace fixesSylvain Munaut1-2/+2
2011-12-08correctly compute the ICCID (19 digits, including luhn checksum)Harald Welte1-4/+11
2011-11-22pySim-prog.py: pyflakes doesn't find Importerror..Holger Hans Peter Freyther1-1/+1
Importerror -> ImportError, spotted by pyflakes.
2010-12-23pySim-prog: Fix insertion of Ki in HLR. Need to escape like DBI does itSylvain Munaut1-1/+34
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-23pySim-prog: Fix crash when using manuam imsi/iccid/kcSylvain Munaut1-1/+2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-23pySim-prog: Check that batch mode is used with auto parametersSylvain Munaut1-0/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-09pySim-prog: Change logic to support batch programmingSylvain Munaut1-29/+129
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-09transport: Change transport api to allow for wait_for_card/connect/disconnectSylvain Munaut1-0/+3
This way, we can re-use the same transport parameters for several cards for a future batch mode Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-08pySim-prog: Fix pcsc device selection and link creationSylvain Munaut1-2/+2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-08pySim-prog: Add options to save generated parameters to CVS or OpenBSC HLRSylvain Munaut1-0/+51
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-08pySim-prog: Show default for mnc in help modeSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-08pySim-prog: Group option for serial (dev & baud) togetherSylvain Munaut1-4/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-07Split all things into a more "library-like" packageSylvain Munaut1-0/+288
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>