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


Change subject: pySim-shell.py: add a command for RUN GSM ALGORITHM
......................................................................

pySim-shell.py: add a command for RUN GSM ALGORITHM

Change-Id: Id7876d83d018aca79253784411d3a9d54a249a0a
---
M pySim/ts_51_011.py
1 file changed, 25 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/15/31815/1

diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py
index 96de241..b9e19b2 100644
--- a/pySim/ts_51_011.py
+++ b/pySim/ts_51_011.py
@@ -1102,6 +1102,8 @@
 class DF_GSM(CardDF):
     def __init__(self, fid='7f20', name='DF.GSM', desc='GSM Network related 
files'):
         super().__init__(fid=fid, name=name, desc=desc)
+        self.shell_commands += [self.AddlShellCommands()]
+
         files = [
             EF_LP(),
             EF_IMSI(),
@@ -1171,6 +1173,20 @@
         ]
         self.add_files(files)

+    @with_default_category('Application-Specific Commands')
+    class AddlShellCommands(CommandSet):
+        def __init__(self):
+            super().__init__()
+
+        authenticate_parser = argparse.ArgumentParser()
+        authenticate_parser.add_argument('rand', help='Random challenge')
+
+        @cmd2.with_argparser(authenticate_parser)
+        def do_authenticate(self, opts):
+            """Perform GSM Authentication."""
+            (data, sw) = self._cmd.card._scc.run_gsm(opts.rand)
+            self._cmd.poutput_json(data)
+

 class CardProfileSIM(CardProfile):


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id7876d83d018aca79253784411d3a9d54a249a0a
Gerrit-Change-Number: 31815
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to