aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-read.py
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-03-11 13:03:18 +0100
committerHarald Welte <laforge@osmocom.org>2021-04-02 16:21:14 +0200
commitcba6dbce9a50c651608e60efb0c263afe77d2eaf (patch)
tree994975a40a4039a6937851ea3ce3fe22320a7fa9 /pySim-read.py
parentad073e834ae4bd2574634628dd2af7e308c2d143 (diff)
fileystem: fix ADF selection
When the ADF is selected, then this is done by the AID. At the moment only the first 7 bytes of the AID are used to select the ADF. sysmo-isim-sja2 tolerates this, but sysmo-usim-sjs1 does not. The Cards class already has methods to deal with this problem. The method select_adf_by_aid takes an ADF name and completes the AID from an internal list. This can be extended to support partial hexadecimal AIDs as well. Change-Id: If99b143ae5ff42a889c52e8023084692e709e1b1 Related: OS#4963
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-xpySim-read.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pySim-read.py b/pySim-read.py
index 7906685..638bd4b 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -251,7 +251,8 @@ if __name__ == '__main__':
# Check whether we have th AID of USIM, if so select it by its AID
# EF.UST - File Id in ADF USIM : 6f38
- if '9000' == card.select_adf_by_aid():
+ data, sw = card.select_adf_by_aid(adf="usim")
+ if sw == '9000':
# Select USIM profile
usim_card = UsimCard(scc)
@@ -300,7 +301,8 @@ if __name__ == '__main__':
print("ePDGSelection: Can't read file -- " + str(e))
# Select ISIM application by its AID
- if '9000' == card.select_adf_by_aid(adf="isim"):
+ data, sw = card.select_adf_by_aid(adf="isim")
+ if sw == '9000':
# Select USIM profile
isim_card = IsimCard(scc)
@@ -352,7 +354,8 @@ if __name__ == '__main__':
# 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"):
+ data, sw = card.select_adf_by_aid(adf="isim")
+ if sw == '9000':
# EF.IST
(res, sw) = card.read_binary('6f07')
if sw == '9000':