Change in ...pysim[master]: pySim-prog: Print out hex-escaped pin_adm in card parameters

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

daniel gerrit-no-reply at lists.osmocom.org
Tue Sep 3 18:13:07 UTC 2019


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


Change subject: pySim-prog: Print out hex-escaped pin_adm in card parameters
......................................................................

pySim-prog: Print out hex-escaped pin_adm in card parameters

Use h2b to convert pin_adm back to binary form for sysmoSIMgr2

Change-Id: Ia178c9938f3e6a4fbac24d767437894297d1e708
---
M pySim-prog.py
M pySim/cards.py
2 files changed, 10 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/92/15392/1

diff --git a/pySim-prog.py b/pySim-prog.py
index 2638eef..7edadd7 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -406,14 +406,15 @@
 def print_parameters(params):
 
 	print """Generated card parameters :
- > Name    : %(name)s
- > SMSP    : %(smsp)s
- > ICCID   : %(iccid)s
- > MCC/MNC : %(mcc)d/%(mnc)d
- > IMSI    : %(imsi)s
- > Ki      : %(ki)s
- > OPC     : %(opc)s
- > ACC     : %(acc)s
+ > Name     : %(name)s
+ > SMSP     : %(smsp)s
+ > ICCID    : %(iccid)s
+ > MCC/MNC  : %(mcc)d/%(mnc)d
+ > IMSI     : %(imsi)s
+ > Ki       : %(ki)s
+ > OPC      : %(opc)s
+ > ACC      : %(acc)s
+ > ADM1(hex): %(pin_adm)s
 """	% params
 
 
diff --git a/pySim/cards.py b/pySim/cards.py
index 55282aa..cda337a 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -496,7 +496,7 @@
 		# P2: CHV number, as in VERIFY CHV for PIN, and as in UNBLOCK CHV for PUK
 		# P3: 08, CHV length (curiously the PUK is also 08 length, instead of 10)
 		if p['pin_adm']:
-			pin = p['pin_adm']
+			pin = h2b(p['pin_adm'])
 		else:
 			pin = h2b("4444444444444444")
 

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia178c9938f3e6a4fbac24d767437894297d1e708
Gerrit-Change-Number: 15392
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190903/86ab3c20/attachment.htm>


More information about the gerrit-log mailing list