aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSupreeth Herle <herlesupreeth@gmail.com>2020-03-24 13:03:43 +0100
committerherlesupreeth <herlesupreeth@gmail.com>2020-10-21 08:32:55 +0200
commit99d55552d5b37905e2a551c18024fca869f3c321 (patch)
tree419f00c243963dd87955227f9395261bf3ea278b
parent95b4e8d4fa85d984ec9c2f19d3c5f44160f0b22f (diff)
pySim-read.py: Enable parsing of EF.ePDGSelection in USIM
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
-rwxr-xr-xpySim-read.py12
-rw-r--r--pySim/cards.py7
-rw-r--r--pysim-testdata/sysmoISIM-SJA2.ok6
3 files changed, 25 insertions, 0 deletions
diff --git a/pySim-read.py b/pySim-read.py
index 6608556..2be34bd 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -36,6 +36,7 @@ from pySim.commands import SimCardCommands
from pySim.cards import card_detect, Card
from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn
from pySim.utils import format_xplmn_w_act, dec_spn, dec_st, init_reader, dec_epdgid
+from pySim.utils import h2s, format_ePDGSelection
def parse_options():
@@ -282,6 +283,17 @@ if __name__ == '__main__':
except Exception as e:
print("ePDGId: Can't read file -- " + str(e))
+ #EF.ePDGSelection - ePDG Selection Information
+ try:
+ if card.file_exists(EF_USIM_ADF_map['ePDGSelection']):
+ (res, sw) = card.read_ePDGSelection()
+ if sw == '9000':
+ print("ePDGSelection:\n%s" % (res,))
+ else:
+ print("ePDGSelection: Can't read, response code = %s" % (sw,))
+ except Exception as e:
+ print("ePDGSelection: Can't read file -- " + str(e))
+
# Check whether we have th AID of ISIM, if so select it by its AID
# EF.IST - File Id in ADF ISIM : 6f07
if '9000' == card.select_adf_by_aid(adf="isim"):
diff --git a/pySim/cards.py b/pySim/cards.py
index 1d5f5c6..6243d4a 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -277,6 +277,13 @@ class UsimCard(Card):
EF_USIM_ADF_map['ePDGId'], epdgid_tlv)
return sw
+ def read_ePDGSelection(self):
+ (res, sw) = self._scc.read_binary(EF_USIM_ADF_map['ePDGSelection'])
+ if sw == '9000':
+ return (format_ePDGSelection(res), sw)
+ else:
+ return (None, sw)
+
def read_ust(self):
(res, sw) = self._scc.read_binary(EF_USIM_ADF_map['UST'])
if sw == '9000':
diff --git a/pysim-testdata/sysmoISIM-SJA2.ok b/pysim-testdata/sysmoISIM-SJA2.ok
index 947cff6..b6836e7 100644
--- a/pysim-testdata/sysmoISIM-SJA2.ok
+++ b/pysim-testdata/sysmoISIM-SJA2.ok
@@ -165,6 +165,12 @@ USIM Service Table: beff9f9de73e0408400170730000002e00000000
ePDGId:
Not available
+ePDGSelection:
+ ffffffffffff # unused
+ ffffffffffff # unused
+ ffffffffffff # unused
+ ffffffffffff # unused
+
ISIM Service Table: 190200
Service 1 - P-CSCF address
Service 4 - GBA-based Local Key Establishment Mechanism