Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
This way we can have optional fields like adm1 in the file
Also require iccid as identifier for the SIM card
Change-Id: I0d317ea51d0cf582b82157eec6cdec074001a236
|
|
Change-Id: Ic5fdd397244cfe73b5b6a12883316072cc10f7b4
|
|
Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
|
|
Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
|
|
Change-Id: I25b859374e33654e58d07061926bf8529eab87f3
|
|
Change-Id: Iad0a328c6f0c9a4ab678efe068801849be48d8fc
|
|
Allow decoding and pretty printing of PLMNwAcT, HPLMNwAcT and OPLMNwAct.
Includes unit tests for the added functions.
Change-Id: I9b8ca6ffd98f665690b84239d9a228e2c72c6ff9
|
|
This test data is used by the jenkins build verification for pySim,
and it was previously located locally on the build slave.
By moving the testdata to this repository, any contributor can
modify both the code and the expected test results simultaneously.
Change-Id: I6714b091a114035d6aab8ba750c5f2b86e438467
|
|
The length field in wavemobile sim cards is not set, so that the field
stays at its initial value, which is 0xFF. Lets write the correct mnc
length here.
Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2
Related: OS#3850
|
|
Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186
|
|
At the moment EF.AD, which contains the length of the MNC is not
updated. For two digit MNC (the usual case) this is fine since the
length is set to 2 by default. However, when one wants to set an MNC
with 3 digit length the file must be updated, otherwise the third digit
of the MNC is recognized as part of the MSIN.
Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65
Related: OS#3850
|
|
EF.OPLMNwAcT
The files EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT are currently not
programmed for sysmo-usim-sjs1, lets add them.
Change-Id: I0cac3041f1902383d98d6dc211cf31ae6e3a610b
Related: OS#3850
|
|
The hexadecimal tag defintions of pytlv are case sensitive strings. So
'A5' is something different than 'a5'. Pytlv uses lower case letters for
the upper hexadecimal digits. Lets correct this.
Change-Id: I41a9933707783f6b1b68ebd91a365405ac0892d0
Related: OS#3850
|
|
Change-Id: Ia895ced62d29e06ae8af05cd95c9d181fb53b9df
|
|
This would facilitate adding new card reader drivers.
Change-Id: Ia893537786c95a6aab3a51fb1ba7169023d5ef97
|
|
This interface allows to use a Calypso based phone (e.g. Motorola
C1XX) as a SIM card reader. It basically implements a few L1CTL
messages that are used to interact with the SIM card through
the OsmocomBB 'layer1' firmware.
Please note, that this is an experimental implementation, and
there is a risk that SIM programming would fail. Nevertheless,
I've managed to program and read one of my SIMs a few times.
Change-Id: Iec8101140581bf9e2cf7cf3a0b54bdf1875fc51b
|
|
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
|
|
When programming or reading a SIM with an IMSI shorter than 15, the IMSI
value is incorrectly encoded/decoded.
The code pads the the IMSI value with 0xF from the left but padding from
the right would be correct.
It also encodes the length as half the number of digits in the IMSI
(rounded up). This isn't correct for even length IMSIs. With even length
IMSIs, the odd/even parity bit bumps the last digit into an extra byte,
which should be counted as well.
- Fix endcoding of IMSI value
- Fix decoding of IMSI value
Change-Id: I9ae4ca4eb7c2965e601a7108843d052ff613beb9
Patch-by: Ben Foxmoore
Closes: SYS#3552
|
|
Change-Id: If69cd2d8af6d544155b3088f77eb6ea4b789901d
Related: SYS#4245
|
|
Add support to handle Wavemobile sim cards. The support excludes some
parameters. For example it is not possible to write own KI keys yet.
Support covers the following files:
EF.SMSP
EF.IMSI
EF.ACC
EF.PLMNsel
EF.PLMNwAcT
EF.OPLMNwAcT
Not yet supported are:
EF.ICCID
KI (propretary file)
OPc (propritary file)
Change-Id: Ida3f37bd6e3ac995812aeddc9770f1ccd54ecf3f
Related: SYS#4245
|
|
Change-Id: I36cfa81f9029bfaedd2e802a2d709596dbeb20ab
Related: OS#3405
|
|
When sysmosom-gr1 is used with a custom ADM key, then the ADM string is
not fed through h2b() like we see it with sysmo-usim-sjs1 for example.
- feed the ADM to h2b() before use
Change-Id: I0b7cab380b89612ed3b8318e014161038335fe1b
Related: OS#3405
|
|
The sysmosim-gr1 lacks the auto detection feature because no autodetect
is yet programmed inside the related class.
- add autodetect for sysmosim-gr1
Change-Id: Iec1f1ab6824ff2328baedd731b08df997df4da01
Related: OS#3405
|
|
Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193
|
|
Some of the USIM-Card programming implementations do not need to look
at card responses, which means they also do not have to parse TLV
data. Lets depend on pytlv only in cases where TLV data has to be
parsed so that useser of cards that do not need at can go without
installing pytlv.
Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6
|
|
So far, the README.md file does not mention much about the
dependencies. This commt adds at lest the most important ones
Change-Id: I912bbf787e1408100183cade2113bf7617b86ffa
|
|
git review uses this file to build the git url.
Change-Id: Ia35aeb33d43ace3c71689d5acbb8d1259ccb7b42
|
|
Run the tests.
Change-Id: I9308f097bf77d82e5ef78d1be551baf127726f74
|
|
Pysim now supports quite a number of different cards. Estimating
if changes in pysim introce regressions becomes increasingly difficult
The script that is added with this patch is intended to run as
atomated testsuit on real cards attached to a test system. However,
it can also be used by developers locally to check for regressions.
Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674
Related: OS#3376
|
|
The method update_plmnsel() does not return the status word yet, which
causes pysim-prog.py to print an error message that does not influence
the functionality but does not look nice.
- preserve the status word that is returned with update_binary() and
return it properly like the other methods do.
Change-Id: I54e8e165f87365e8162b36d24efc8f0db62b66da
Related: SYS#4245
|
|
Change-Id: I506585f8b300bb7a3e20edad7eca134374581d76
|
|
The files EF.PLMNsel, EF.PLMNwAcT, EF.OPLMNwAcT, EF.HPLMNAcT are not
yet printed by pysim-read. Lets add support for those files.
Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c
Related: SYS#4245
|
|
At the moment the exception is catched, but there is only a vague
error message printed. However, the exception string usually tells
us the status word, so it is very valuable to see it. Lets make
sure that the exception string is printed here.
Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a
|
|
There shouldn't be a space between the end of a sentence and a
punctuation mark.
Change-Id: I33f9b8c803ccd185ffa370d235363423d82ba9c7
|
|
The Card class offers update methods for various EF, but for
PLMNsel there is no update method available yet. Lets add one.
Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134
Related: SYS#4245
|
|
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
|
|
Some of the methods SimCardCommands() have ways to determaine length
information from the card response. Regular sims use a format where
the length field is on a fixed position. USIMs use FCP templates
(format control parameters), which is a TLV encodecs string. So lets
distingish if we deal with an USIM (We can easily do this by looking
at the select control parameters) and extract the length info from
the FCP.
- If we deal with USIMs, use the FCP to determine length
information
Change-Id: I068cf8a532e1c79a2d208e9d275c155ddb72713c
Related: SYS#4245
|
|
The method send_apdu() first transmits the APDU in the cards direction.
The card may indicate that there is a response available by responding
with SW1=9F, where SW2 is the number of bytes. send_apdu() will then
craft a get-response APDU to pickup the response bytes. This mechanism
works fine for SIM, but USIM uses SW1=61 to indicate the availability
of a response, so lets also sense on SW1=61 to support USIMs as well.
- Also check on SW1=61 to see if a response is available
Change-Id: Ied7fb78873a7c4109de471c7a5e9c3701ba0c7d5
Related: SYS#4245
|
|
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
|
|
The method send_apdu_checksw() is used to check the SW of the final
response against some pre defined value. However, in many cases the
last two digits of the SW are used to return varying information
(e.g. length information or a more specific status info). To cover
those cases it would be helfpul to define status words that contain
wildcards (e.g. 61**) in order to be able to accept all SWs from
6100 to 61ff.
- When the user supplies an expected SW with wildcards, mask out
those digits in the response before comparing
Change-Id: I5bfc0522b4228b5d9b3415f6e708abcf0da0a7b7
|
|
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
|
|
Change-Id: I4df5681952eefd7a67f5e2b0a96a9e01c9d960d2
|
|
Fix a typo that broke the serial transport.
Change-Id: I7fcc97d505a5369f9f14d4a2abda92b7114a58cd
|
|
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
|
|
Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01
|
|
Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b
|
|
Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3
|
|
Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af
|
|
E.g. Fairwaves SIM cards have longer ADM codes.
Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b
|