This commit introduces a ISIM generic Card class which can hold
parameters/functions specific to ISIM application on UICC
Change-Id: I242e679ff2f8831175e76d2fcc5fb285d28bd890
The Address TLV object is used in EF.P-CSCF Address, EF.ePDGId and EF.ePDGIdEm.
See 3GPP TS 31.102 version 13.4.0 Release 13, section 4.2.8, 4.2.102 and 4.2.104.
Address TLV Object format
Tag (1 Byte) - '80'
Length (1 Byte)
Address Type (1 Byte) - '00' (FQDN), '01' (IPv4), '02' (IPv6)
Address (Address Length Bytes)
Change-Id: Ifd8a240f6b5c7736e58a8151295c30ec5b32ed5f
Service 106 and 107 must be set available in order to ME to consider as supported in USIM:
1. ePDG configuration Information support
2. ePDG configuration Information configured
Change-Id: Ica067915b9d06ba67f53da7d628f8bacde1ab80e
If the EF.ePDGSelection is present, it is populated with a single entry with PLMN 1 set
to Home PLMN of USIM, ePDG FQDN format set to Operator Identifier FQDN and ePDG Priority value
set to 1.
Change-Id: I92f3f813afa41ae497ebc0dc2ca73da810f82364
As per TS 31.102, this EF can found under ADF.USIM at File Id 6ff4.
Also, if service n°106 and service n°107 are available, this file shall be present.
Change-Id: I98916e6f5c9791aff63c18a3b16bdfb8ae9b2d36
Example:
./pySim-prog.py -p 0 -x 001 -y 01 -s 8988211900000000004 -i 001011234567895 \
-k 8baf473f2f8fd09487cccbd7097c6862 --op 11111111111111111111111111111111 \
-o 8E27B6AF0E692E750F32667A3B14605D -a 85524953 -n isim.test \
--msisdn 0598765432100 --epdgid epdg.epc.mnc001.mcc001.pub.3gppnetwork.org
Note:
1. For Operator Identifier based ePDG FQDN must be in the format
epdg.epc.mnc<MNC>.mcc<MCC>.pub.3gppnetwork.org
2. For Tracking/Location Area Identity based ePDG FQDN must be in format
lac<LAC>.epdg.epc.mnc<MNC>.mcc<MCC>.pub.3gppnetwork.org
and
tac-lb<TAC-low-byte>.tac-hb<TAC-high-byte>.tac.epdg.epc.mnc<MNC>.mcc<MCC>.pub.3gppnetwork.org
and
3. For 5GS Tracking Area Identity based ePDG FQDN using a 3 octet TAC
tac-lb<TAC-low-byte>.tac-mb<TAC-middle-byte>.tac-hb<TAC-high-byte>.5gstac. epdg.epc.mnc<MNC>.mcc<MCC>.pub.3gppnetwork.org
Change-Id: Ia00bfea36c50b6a38a5387d2f8147f25c81b1de4
Basically, the idea is to read all the AIDs on the UICC once
rather than reading each time we want to select an ADF.
The function select_adf_by_aid select the ADF by its AID which
is already populated by read_aids() function
Change-Id: I5e0e87e9cf238922d60fda7a7836e65f91f2c233
If the EF.EHPLMN exists, it contains the "Equivalent Home PLMN List".
The odd part of that list is that it is not just a list of additional
PLMN identities, but if the first digits of the IMSI are *not* listed
in EF.EHPLMN, then the MCC/MNC of the IMSI prefix is suddently no
longer considered the home network, but the subscriber is roaming.
See TS 23.122: "If the HPLMN code derived from the IMSI is not present
in the EHPLMN list, then it shall be treated as a Visited PLMN for PLMN
selection purposes."
Change-Id: I22d96ab4a424ec5bc1fb02f5e80165c646a748d3
the EF files in the USIM ADF are different to the ones int the GSM dir
so added the dictionary to avoid conflicts and hardcoded values
the 'DIR' one was added in ts_51_011.py, not sure if it should be there
as it's not in that standard, but did it for simplicity
Change-Id: I458380bf46b2986662ecdede2551c22cd9be92ba
Some of the cards do not implement the erase method that each card
should have. However, having an empty method in each of those classes
does not make too much sense. Lets rather have an erase method in the
superclass (Card) that prints a warning to inform the user that erasing
the spcified card is not supported.
Change-Id: If5add960ec0cab58a01d8f83e6af8cb86ec70a8d
Resetting the contents of a file before re-writing it with parameters
might be helpful when implementing the currently empty erase() methods
of the various card implementations. Lets add two methods, one for
resetting a binary file and one for resetting a specific record in a
record oriented file
Change-Id: I3c3a4ef3d3f358404af307a68a20b7059f1a9e8d
The contents of EF.AD me be uninitalized (all bytes set to 0xff). If
this is the case reset all bytes of the file to 0x00 and continue the
update of EF.AD with this value.
Change-Id: I57cf53e0c540469f11b6d85bd3daf3f9e14c237e
The method update_ad() caluclates the size of the data it had just
read from EF.AD, but the result is never used, lets remove that
line
Change-Id: Id38c0dc725ab6874de3ea60132482a09372abe9e
If AID of the desired ADF is in the list of AIDs of the Card/Card subclass object
then ADF is selected or else None is returned
Change-Id: Ie5f29eec14f099add1d0978e3e7d4ed3c9130854
As per TS.51.011, This EF indicates which services in the SIM are allocated, and whether, if allocated, the service is activated
.If a service is not indicated as available in the SIM, the ME shall not select this service.
Change-Id: Id28a35727adbaaa9df19b1adc621a0c51ad0e51b
This is a generic function applicable for reading EF records which doesnt require further processing
such EF.SMSP etc while decoding and also to avoid code duplication.
Change-Id: Ic0b4aa11e962b4bb328447b11533136a29ff72d3
This is a generic function applicable for reading EFs which doesnt require further processing
such as GID1, GID2 etc while decoding and also to avoid code duplication.
Change-Id: If3d8fdddb26f9776c89fd442d1d95b83e0d1476b
This function is used to detect the card type and return Card class/Card subclasses object
if its a know card or else None. Also, an initial step towards refactoring of code.
Change-Id: I71f57c6403dc933bd9d54f90df3d3fe105b4f66f
Introduced a new member variable and a member function to Card class to fetch
and store the AIDs present in UICC. And, this variable (a list) is populated
by reading the EF 2f00 under MF 3f00 (function read_aids()).
Change-Id: I7ca77a73ebb42a8ba1381588d878040675d3019a
When pysim-prog programms the application specific files of ISIM and
USIM it selects the application by its AID first. If depending on the
card profile one of the applications is missing the selection of the
related ADF will fail. Lets check the presence of the AID first and if
it is not present lets skip the programming of the related files.
Change-Id: I0eec6ed244320fcd4dc410b6fab20df9c64ff906
Related: SYS#4817
There is a new card version with a different ATR, lets add the ATR for
this card to support it as well.
Change-Id: I222faea89c1df58c36a19b28449dffb84a956e74
Related: SYS#4817
In Python 3, traditional division operator returns a float,
while we need a floor integer in the most cases.
Change-Id: I5565eb64a1ddea7075cbb142eaacaa5d494c87bb
This change implements programming of EF.MSISDN as per 3GPP TS 31.102,
sections 4.2.26 and 4.4.2.3, excluding the following fields:
- Alpha Identifier (currently 'FF'O * 20),
- Capability/Configuration1 Record Identifier ('FF'O),
- Extension1 Record Identifier ('FF'O).
This feature is introduced exclusively for sysmoUSIM-SJS1.
Othere SIM card types need to be tested.
Change-Id: Ie033a0ffc3697ae562eaa7a241a0f6af6c2b0594
The sysmo-isim-sja2 cards are not yet supported by pysim. Lets add
support for writing KI and OPC in ADF.USIM and ADF.ISIM as well as the
remaining common simcard parameters.
Related: SYS#4466
Change-Id: I23e2b46eac0e0dbc2b271983d448999f6a459ecf
pySim-prog.py features a way to detect which card type is in the reader.
The returned value is often used as filename for testfiles and other
automated operations. Therefore lets not have spaces in simcard names
Change-Id: Ib7428fab767874dd53478d7c64601ff8938e05aa
Without that fix we have:
$ python3 pySim-read.py
File "pySim-read.py", line 135
try:
^
TabError: inconsistent use of tabs and spaces in indentation
The following command was used to do the conversion:
sed 's# #\t#g' -i $(find -name "*.py")
Then the remaining spaces spotted during the review were
addressed manually.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Change-Id: I83f76a8e9b6e36098f16552a0135a8c22dde545f
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
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
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
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
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
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
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
The programming procedure for sysmo-usim-sjs1 lacks
writing the ICCID. This commit adds the missing call
to update_binary()
Change-Id: Ief85aa07c562d8d7b2a6dec302d2f485d0b1e577
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