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

dexter gerrit-no-reply at lists.osmocom.org
Tue Mar 30 10:06:30 UTC 2021


dexter has submitted this change. ( 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(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210330/fa467707/attachment.htm>


More information about the gerrit-log mailing list