aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-04-22 15:52:38 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-04-22 15:54:00 +0300
commitda2fa83256a736d14ffa496919492978f945f123 (patch)
tree113c6fbbafd08127456a7be700fe18075acc919c
parent686581985921a5b754d75ec33e90e5f122a3114b (diff)
pySim-shell.py: add a command for RUN GSM ALGORITHMfixeria/run_gsm_alg
-rwxr-xr-xpySim-shell.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pySim-shell.py b/pySim-shell.py
index 06977f0..ed90fd9 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -866,6 +866,16 @@ class Iso7816Commands(CommandSet):
self._cmd.poutput(
'Negotiated Duration: %u secs, Token: %s, SW: %s' % (duration, token, sw))
+ run_gsm_algo_parser = argparse.ArgumentParser()
+ run_gsm_algo_parser.add_argument('rand', type=str, help='RAND value')
+
+ # not ISO7816-4 but TS 102 221
+ @cmd2.with_argparser(run_gsm_algo_parser)
+ def do_run_gsm_algo(self, opts):
+ (data, sw) = self._cmd.card._scc.run_gsm(opts.rand)
+ self._cmd.poutput('SRES: %s' % data[:8])
+ self._cmd.poutput('Kc: %s' % data[8:])
+
option_parser = argparse.ArgumentParser(prog='pySim-shell', description='interactive SIM card shell',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)