Change in ...pysim[master]: make writing SMSP optional

laforge gerrit-no-reply at lists.osmocom.org
Wed Aug 28 21:20:53 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/15312


Change subject: make writing SMSP optional
......................................................................

make writing SMSP optional

Change-Id: Ic5fdd397244cfe73b5b6a12883316072cc10f7b4
---
M pySim/cards.py
1 file changed, 8 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/12/15312/1

diff --git a/pySim/cards.py b/pySim/cards.py
index cb42d83..55282aa 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -394,8 +394,9 @@
 			data, sw = self._scc.update_binary('6f78', lpad(p['acc'], 4))
 
 		# EF.SMSP
-		r = self._scc.select_file(['3f00', '7f10', '6f42'])
-		data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 80))
+                if p.get('smsp'):
+			r = self._scc.select_file(['3f00', '7f10', '6f42'])
+			data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 80))
 
 		# Set the Ki using proprietary command
 		pdu = '80d4020010' + p['ki']
@@ -535,7 +536,8 @@
 		r = self._scc.select_file(['3f00', '7f10'])
 		
 		# write EF.SMSP
-		data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 80))
+                if p.get('smsp'):
+			data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 80))
 
 	def erase(self):
 		return
@@ -614,8 +616,9 @@
 				print("Programming AD failed with code %s"%sw)
 
 		# EF.SMSP
-		r = self._scc.select_file(['3f00', '7f10'])
-		data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True)
+		if p.get('smsp'):
+			r = self._scc.select_file(['3f00', '7f10'])
+			data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True)
 
 	def erase(self):
 		return

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic5fdd397244cfe73b5b6a12883316072cc10f7b4
Gerrit-Change-Number: 15312
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at gnumonks.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190828/822f711a/attachment-0001.html>


More information about the gerrit-log mailing list