Alexander Chemeris
d2d660a935
Add methods to get ATR for a card or a link.
...
Implemented for both serial and PCSC readers.
Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc
2018-01-10 17:12:10 +09:00
Alexander Chemeris
dddbf525da
utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6
...
Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30
2018-01-10 14:04:17 +09:00
Alexander Chemeris
a5f0ea6979
utils: Functions to encode/decode EF SPN.
...
According to TS 51 011.
Change-Id: Ida184bc5c81cc8c228b8981b703f77d017e53334
2018-01-10 14:04:11 +09:00
Alexander Chemeris
067f69cade
ts_51_011: A file with MF/DF/EF constants from TS 51 011
...
pySim has been using magic numbers to access various files which makes it hard
to read, maintain and extend. With this file in place we can start replacing all
those magic numbers with human readable names lile EF['IMSI'] instead of
['3F00', '7F20', '6F07'].
Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932
2018-01-10 14:04:08 +09:00
Pau Espin
665bd22fc5
utils.py: dec_imsi: Fix ValueError
...
It should fix the following observed error:
~/pysim$ ./pySim-read.py -p0
Reading ...
ICCID:
Traceback (most recent call last):
File "./pySim-read.py", line 99, in <module>
print("IMSI: %s" % (dec_imsi(res),))
File "/home/lab434/pysim/pySim/utils.py", line 57, in dec_imsi
l = int(ef[0:2]) * 2 # Length of the IMSI string
ValueError: invalid literal for int() with base 10: 'ff'
Change-Id: I7d3ecbf9edd190d1941816796cee60e3957d5943
2018-01-02 07:20:57 +00:00
Daniel Willmann
1d087efc97
Support writing SMSP for sysmoUSIM-SJS1
...
Closes: OS#1989
Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a
2017-09-01 07:56:13 +00:00
Philipp Maier
e960488338
fix writing of ICCID for sysmo-usim-sjs1
...
The programming procedure for sysmo-usim-sjs1 lacks
writing the ICCID. This commit adds the missing call
to update_binary()
Change-Id: Ief85aa07c562d8d7b2a6dec302d2f485d0b1e577
2017-04-06 00:38:22 +02:00
Philipp Maier
4146086d2f
Fix select control parameter
...
sysmo-usim-sjs1 requires P2 to be set to 0x0C (request FCI) when
using the USIM application commands. The FCI is not used by pysim
anyway and might even cause problems with other cards.
This commit adds a pair of get/set methods to the SimCardCommands
class in order to set a default for the selection control
parameters (P1, P2). (Similar to the set/get methods for the class
byte)
The SysmoUSIMSJS1 class now calls the setter method for the
selection control parameters inside of its constructuor and sets
the selection control parameter default to "000C". This way we
can be sure that we only change the behaviour for sysmo-usim-sjs1
and do not break support for any other cards.
Change-Id: I1993a267c952bf37d5de1cb4e1107f445614c17b
2017-04-06 00:38:22 +02:00
Neels Hofmeyr
3ce84d9a44
cosmetic: missing newlines on last line of 2 files
...
It's hard to keep this out of real patches, since normally editors add the
final newline automatically.
2017-03-21 13:07:57 +01:00
Harald Welte
9a1dcea7b3
Revert "Do not return the FCI information while selecting a file"
...
This reverts commit 8c1b33c439
.
2016-10-27 14:40:02 +02:00
Jan Balke
8c1b33c439
Do not return the FCI information while selecting a file
...
The sysmoUSIM-SJS1 card does not support returning the FCI
information.
Plus, the FCI information are not used anyway.
2015-08-20 13:32:56 +02:00
Jan Balke
3e84067a2b
Add provision support for sysmoUSIM-SJS1 cards
...
The PIN-ADM has to given on the command line as it is provisioned
different for each card.
Currently only Ki, Op and IMSI are provisioned.
2015-08-20 13:32:56 +02:00
Jan Balke
c3ebd33544
Add PIN-ADM argument to the command line
...
Allow overwriting the default PIN-ADM set in the card implementation.
2015-08-20 13:32:56 +02:00
Jan Balke
14b350f3a1
Allow changing the class byte for pdu messages
2015-08-20 13:32:03 +02:00
Sylvain Munaut
2fc205ceb9
cards: sysmocom SysmoSIM-GR2 support added to cards
...
Written-by: Kevin Redon
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-23 17:22:56 +01:00
Alexander Chemeris
7be92ff5d2
Move encoder functions for ICCID, IMSI and PLMN to pySim.utils for consistency.
2013-07-13 08:53:21 +02:00
Alexander Chemeris
5e96c3d910
utils: Add functions to decode IMSI and ICCID from EF raw data.
2013-07-13 08:49:03 +02:00
Alexander Chemeris
21885249cf
Implement setting of EF.ACC file in GrcardSim and _MagicSimBase
...
From: Alexander Chemeris <Alexander.Chemeris@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-07-02 15:19:09 +02:00
Sylvain Munaut
5da8d4e0d4
cards: Fix spacing according to PEP
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-07-02 15:13:24 +02:00
Sylvain Munaut
053c89578c
cards: Fix comment position
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-07-02 15:12:32 +02:00
Harald Welte
93b38cd0f5
usim/opc: Add support to write completely random OPC
...
Allow to set the OPC, write it out to the state, generate it randomly.
2012-03-22 15:25:19 +01:00
Holger Hans Peter Freyther
4d91bf449f
sysmoUSIM-GR1: Add basic (hacky) support for the sysmoUSIM-GR1
...
Right now we are only to program the KI, OPC, ICCID and IMSI. This
is done in a direct way and through the card abstraction.
2012-03-22 14:28:38 +01:00
Sylvain Munaut
8ca49e9ca8
cards: SMSP is left padded not right padded
...
I confused left & right, silly me ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-12-10 09:57:50 +01:00
Sylvain Munaut
607ce2a029
Fix computation of SMSP from a SMSC number
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-12-08 20:16:43 +01:00
Harald Welte
e10394bfb6
Add sysmoSIM-GR1 as alias to grcardsim
2011-12-08 19:39:49 +01:00
Harald Welte
2c0ff3a167
correctly compute the ICCID (19 digits, including luhn checksum)
2011-12-08 19:39:49 +01:00
Harald Welte
3156d9073f
cards: Add support for grcard.cn (Green Card) SIM cards
...
This does not have auto-detection (yet), so you have to explicitly
specify "-t grcardsim" on the command line
2011-03-22 21:48:19 +01:00
Harald Welte
982a3075f9
commands: Check SW for UPDATE BIN / UPDATE REC / VERIFY CHV
2011-03-22 21:47:20 +01:00
Sylvain Munaut
530076ebba
commands: Fix bug in verify_chv.
...
Didn't get adapted properly to support several transports ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-23 20:28:58 +01:00
Sylvain Munaut
bdca252fb0
transport: Change transport api to allow for wait_for_card/connect/disconnect
...
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-09 13:31:58 +01:00
Sylvain Munaut
245d534962
transport/pcsc: Remove obsolete/debug code
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-08 22:42:07 +01:00
Sylvain Munaut
e7c15cd088
transport: Put common methods in LinkBase class
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-07 10:01:55 +01:00
Sylvain Munaut
76504e0a6e
Split all things into a more "library-like" package
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-07 00:24:32 +01:00