[MERGED] pysim[master]: fix writing of ICCID for sysmo-usim-sjs1

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Apr 6 11:56:16 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix writing of ICCID for sysmo-usim-sjs1
......................................................................


fix writing of ICCID for sysmo-usim-sjs1

The programming procedure for sysmo-usim-sjs1 lacks
writing the ICCID. This commit adds the missing call
to update_binary()

Change-Id: Ief85aa07c562d8d7b2a6dec302d2f485d0b1e577
---
M pySim/cards.py
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  dexter: Looks good to me, but someone else must approve; Verified
  Neels Hofmeyr: Looks good to me, approved



diff --git a/pySim/cards.py b/pySim/cards.py
index fafc55f..925c5e6 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -434,19 +434,19 @@
 
 	def program(self, p):
 
+		# authenticate as ADM using default key (written on the card..)
+		if not p['pin_adm']:
+			raise ValueError("Please provide a PIN-ADM as there is no default one")
+		self._scc.verify_chv(0x0A, h2b(p['pin_adm']))
 
 		# select MF
 		r = self._scc.select_file(['3f00'])
 
+		# write EF.ICCID
+		data, sw = self._scc.update_binary('2fe2', enc_iccid(p['iccid']))
+
 		# select DF_GSM
 		r = self._scc.select_file(['7f20'])
-
-		# authenticate as ADM using default key (written on the card..)
-		if not p['pin_adm']:
-			raise ValueError("Please provide a PIN-ADM as there is no default one")
-
-		self._scc.verify_chv(0x0A, h2b(p['pin_adm']))
-
 
 		# set Ki in proprietary file
 		data, sw = self._scc.update_binary('00FF', p['ki'])

-- 
To view, visit https://gerrit.osmocom.org/2175
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ief85aa07c562d8d7b2a6dec302d2f485d0b1e577
Gerrit-PatchSet: 3
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list