mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-25 23:08:34 +03:00
pySim-shell.py: add a command for RUN GSM ALGORITHM
Change-Id: Id7876d83d018aca79253784411d3a9d54a249a0a
This commit is contained in:
@@ -1102,6 +1102,8 @@ class EF_MMSUCP(TransparentEF):
|
|||||||
class DF_GSM(CardDF):
|
class DF_GSM(CardDF):
|
||||||
def __init__(self, fid='7f20', name='DF.GSM', desc='GSM Network related files'):
|
def __init__(self, fid='7f20', name='DF.GSM', desc='GSM Network related files'):
|
||||||
super().__init__(fid=fid, name=name, desc=desc)
|
super().__init__(fid=fid, name=name, desc=desc)
|
||||||
|
self.shell_commands += [self.AddlShellCommands()]
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
EF_LP(),
|
EF_LP(),
|
||||||
EF_IMSI(),
|
EF_IMSI(),
|
||||||
@@ -1171,6 +1173,20 @@ class DF_GSM(CardDF):
|
|||||||
]
|
]
|
||||||
self.add_files(files)
|
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):
|
class CardProfileSIM(CardProfile):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user