aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-shell.py
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-04-03 09:00:16 +0200
committerHarald Welte <laforge@osmocom.org>2021-04-04 10:36:00 +0200
commit4442b3d1c089992c4afef35d79910a9236b693e4 (patch)
tree110ae0b91e0c874546ad4ea156d4a8d2f50d41d8 /pySim-shell.py
parent90d3b970afcc81ac52221a7c341e998bb4293b0a (diff)
rename card_data to card_key_provider.
"data" is an awfully generic term. Anything stored on a card is data. This specific code deals with resolving key/pin material from an external source. Change-Id: I4c8e1be3e766f7c0565c07b39d48abf8adc375af
Diffstat (limited to 'pySim-shell.py')
-rwxr-xr-xpySim-shell.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pySim-shell.py b/pySim-shell.py
index 931b5ea..d27deb7 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -48,7 +48,7 @@ from pySim.ts_102_221 import CardProfileUICC
from pySim.ts_31_102 import CardApplicationUSIM
from pySim.ts_31_103 import CardApplicationISIM
-from pySim.card_data import CardDataCsv, card_data_register, card_data_get_field
+from pySim.card_key_provider import CardKeyProviderCsv, card_key_provider_register, card_key_provider_get_field
class PysimApp(cmd2.Cmd):
@@ -95,7 +95,7 @@ class PysimApp(cmd2.Cmd):
pin_adm = sanitize_pin_adm(arg)
else:
# try to find an ADM-PIN if none is specified
- result = card_data_get_field('ADM1', key='ICCID', value=self.iccid)
+ result = card_key_provider_get_field('ADM1', key='ICCID', value=self.iccid)
pin_adm = sanitize_pin_adm(result)
if pin_adm:
self.poutput("found ADM-PIN '%s' for ICCID '%s'" % (result, self.iccid))
@@ -148,7 +148,7 @@ class Iso7816Commands(CommandSet):
if str(code).upper() not in auto:
return sanitize_pin_adm(code)
- result = card_data_get_field(str(code), key='ICCID', value=self._cmd.iccid)
+ result = card_key_provider_get_field(str(code), key='ICCID', value=self._cmd.iccid)
result = sanitize_pin_adm(result)
if result:
self._cmd.poutput("found %s '%s' for ICCID '%s'" % (code.upper(), result, self._cmd.iccid))
@@ -439,9 +439,9 @@ if __name__ == '__main__':
# or from CSV file in home directory
csv_default = str(Path.home()) + "/.osmocom/pysim/card_data.csv"
if opts.csv:
- card_data_register(CardDataCsv(opts.csv))
+ card_key_provider_register(CardKeyProviderCsv(opts.csv))
if os.path.isfile(csv_default):
- card_data_register(CardDataCsv(csv_default))
+ card_key_provider_register(CardKeyProviderCsv(csv_default))
# 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