Change in pysim[master]: pySim-shell: use -a / -A commandline option to authenticate

dexter gerrit-no-reply at lists.osmocom.org
Mon Mar 29 19:07:40 UTC 2021


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


Change subject: pySim-shell: use -a / -A commandline option to authenticate
......................................................................

pySim-shell: use -a / -A commandline option to authenticate

pySim-shell defines, just like the other pySim programs commandline
arguments that take an ADM pin to authenticate at the card as admin. The
arguments are defined, but not used. Add the missing authentication
part.

Change-Id: I6bed14eb8f4124e28d593cf0816dbe58e7271322
Related: OS#4963
---
M pySim-shell.py
1 file changed, 10 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/35/23535/1

diff --git a/pySim-shell.py b/pySim-shell.py
index e596d11..41febd6 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -339,4 +339,14 @@
 
 	app = PysimApp(card, rs, opts.script)
 	rs.select('MF', app)
+
+	# If the user supplies an ADM PIN at via commandline args authenticate
+	# immediatley so that the user does not have to use the shell commands
+	pin_adm = sanitize_pin_adm(opts.pin_adm, opts.pin_adm_hex)
+	if pin_adm:
+		try:
+			card.verify_adm(h2b(pin_adm))
+		except Exception as e:
+			print(e)
+
 	app.cmdloop()

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6bed14eb8f4124e28d593cf0816dbe58e7271322
Gerrit-Change-Number: 23535
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210329/8837a990/attachment.htm>


More information about the gerrit-log mailing list