This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
guilly@gmail.com gerrit-no-reply at lists.osmocom.orgguilly at gmail.com has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/17933 )
Change subject: cards.py: fix select_aif_by_aid function
......................................................................
cards.py: fix select_aif_by_aid function
current implementation does not work, as select_adf expects the
full name, as returned by read_aid.
turned it into a wrapper, otherwise it's not possible to do the
selection from an app
Change-Id: I1391869e5c302fdcc03e9972f179e865dfd443a9
---
M pySim/cards.py
M pySim/ts_51_011.py
2 files changed, 11 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/17933/1
diff --git a/pySim/cards.py b/pySim/cards.py
index c0462fb..89de66c 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -23,7 +23,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from pySim.ts_51_011 import EF, DF
+from pySim.ts_51_011 import EF, DF, MF
from pySim.utils import *
from smartcard.util import toBytes
@@ -235,23 +235,14 @@
print("Can't read AIDs from SIM -- %s" % (str(e),))
# Select ADF.U/ISIM in the Card using its full AID
- def select_adf_by_aid(self, adf="usim"):
- # Check for valid ADF name
- if adf not in ["usim", "isim"]:
- return None
-
- # First (known) halves of the U/ISIM AID
- aid_map = {}
- aid_map["usim"] = "a0000000871002"
- aid_map["isim"] = "a0000000871004"
-
- for aid in self._aids:
- if aid_map[adf] in aid:
- (res, sw) = self._scc.select_adf(aid)
- return sw
-
- return None
-
+ def select_adf_by_aid(self, aid):
+ sw = self._scc.select_file(MF)
+ if sw == '9000':
+ (res, sw) = self._scc.select_adf(aid)
+ return sw
+ return (None, sw)
+
+
class _MagicSimBase(Card):
"""
diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py
index 1cec91f..31e7b31 100644
--- a/pySim/ts_51_011.py
+++ b/pySim/ts_51_011.py
@@ -139,6 +139,8 @@
'MMSUCP': '6FD2',
}
+MF = [MF_num]
+
DF = {
'TELECOM': [MF_num, DF_num['TELECOM']],
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/17933
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1391869e5c302fdcc03e9972f179e865dfd443a9
Gerrit-Change-Number: 17933
Gerrit-PatchSet: 1
Gerrit-Owner: guilly at gmail.com <guilly at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200423/24b62726/attachment.htm>