Change in pysim[master]: cards.py: Added parsing of all the AIDs in the UICC

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/.

herlesupreeth gerrit-no-reply at lists.osmocom.org
Tue Mar 17 17:52:13 UTC 2020


herlesupreeth has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/17498 )


Change subject: cards.py: Added parsing of all the AIDs in the UICC
......................................................................

cards.py: Added parsing of all the AIDs in the UICC

Introduced a new member variable to Card class to store the AIDs present in UICC.
And, populated this variable (a list) upon creating a Card object/Card subclass object by
reading the EF 2f00 under MF 3f00.

Change-Id: I0828f411e07a01464abed7fd05486e1a56603411
---
M pySim/cards.py
1 file changed, 13 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/98/17498/1

diff --git a/pySim/cards.py b/pySim/cards.py
index a872ee0..da9e371 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -32,6 +32,19 @@
 	def __init__(self, scc):
 		self._scc = scc
 		self._adm_chv_num = 4
+		self._aids = []
+
+		try:
+			# Find out how many records the EF.DIR has
+			# and store all the AIDs in the UICC
+			rec_cnt = self._scc.record_count(['3f00', '2f00'])
+			for i in range(0, rec_cnt):
+				rec = self._scc.read_record(['3f00', '2f00'], i + 1)
+				if (rec[0][0:2], rec[0][4:6]) == ('61', '4f') and len(rec[0]) > 12 \
+				and rec[0][8:8 + int(rec[0][6:8], 16) * 2] not in self._aids:
+					self._aids.append(rec[0][8:8 + int(rec[0][6:8], 16) * 2])
+		except Exception as e:
+			pass
 
 	def reset(self):
 		self._scc.reset_card()

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/17498
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0828f411e07a01464abed7fd05486e1a56603411
Gerrit-Change-Number: 17498
Gerrit-PatchSet: 1
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200317/0a105158/attachment.htm>


More information about the gerrit-log mailing list