pysim/pySim
Ben Fox-Moore 0ec147513c utils: fix encoding/decoding of IMSI value
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
2018-09-26 18:14:19 +02:00
..
transport cosmetic: fix excess space in log output (typo) 2018-07-13 08:50:33 +00:00
__init__.py cosmetic: missing newlines on last line of 2 files 2017-03-21 13:07:57 +01:00
cards.py cards: Add support for Wavemobile SIM 2018-09-13 07:18:33 +00:00
commands.py commands: depend on pytlv only when it is actually needed 2018-07-25 18:52:58 +00:00
exceptions.py Split all things into a more "library-like" package 2010-12-07 00:24:32 +01:00
ts_51_011.py ts_51_011: A file with MF/DF/EF constants from TS 51 011 2018-01-10 14:04:08 +09:00
utils.py utils: fix encoding/decoding of IMSI value 2018-09-26 18:14:19 +02:00