mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-17 02:48:34 +03:00
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
This commit is contained in:
@@ -339,4 +339,14 @@ if __name__ == '__main__':
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user