mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-26 07:18:33 +03:00
pySim-shell: Adds support for DEACTIVATE FILE + ACTIVATE FILE
Change-Id: I22207dde20f991b0a22dea8f5dd695a0ec99da33
This commit is contained in:
@@ -120,6 +120,14 @@ it if you authenticate yourself with the said CHV/PIN.
|
|||||||
:module: pySim-shell
|
:module: pySim-shell
|
||||||
:func: Iso7816Commands.verify_chv_parser
|
:func: Iso7816Commands.verify_chv_parser
|
||||||
|
|
||||||
|
deactivate_file
|
||||||
|
~~~~~~~~~~~~~~~
|
||||||
|
Deactivate the currently selected file. This used to be called INVALIDATE in TS 11.11.
|
||||||
|
|
||||||
|
|
||||||
|
activate_file
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Activate the currently selected file. This used to be called REHABILITATE in TS 11.11.
|
||||||
|
|
||||||
|
|
||||||
pySim commands
|
pySim commands
|
||||||
|
|||||||
@@ -403,6 +403,15 @@ class Iso7816Commands(CommandSet):
|
|||||||
(data, sw) = self._cmd.card._scc.enable_chv(opts.pin_nr, h2b(pin))
|
(data, sw) = self._cmd.card._scc.enable_chv(opts.pin_nr, h2b(pin))
|
||||||
self._cmd.poutput("CHV enable successful")
|
self._cmd.poutput("CHV enable successful")
|
||||||
|
|
||||||
|
def do_deactivate_file(self, opts):
|
||||||
|
"""Deactivate the current EF"""
|
||||||
|
fid = self._cmd.rs.selected_file.fid
|
||||||
|
(data, sw) = self._cmd.card._scc.deactivate_file(fid)
|
||||||
|
|
||||||
|
def do_activate_file(self, opts):
|
||||||
|
"""Activate the current EF"""
|
||||||
|
fid = self._cmd.rs.selected_file.fid
|
||||||
|
(data, sw) = self._cmd.card._scc.activate_file(fid)
|
||||||
|
|
||||||
def parse_options():
|
def parse_options():
|
||||||
|
|
||||||
|
|||||||
@@ -296,6 +296,14 @@ class SimCardCommands(object):
|
|||||||
ret = {'successful_3g_authentication': data}
|
ret = {'successful_3g_authentication': data}
|
||||||
return (ret, sw)
|
return (ret, sw)
|
||||||
|
|
||||||
|
def deactivate_file(self):
|
||||||
|
"""Execute DECATIVATE FILE command as per TS 102 221 Section 11.1.14."""
|
||||||
|
return self._tp.send_apdu_constr_checksw(self.cla_byte, '04', '00', '00', None, None, None)
|
||||||
|
|
||||||
|
def activate_file(self):
|
||||||
|
"""Execute ACTIVATE FILE command as per TS 102 221 Section 11.1.15."""
|
||||||
|
return self._tp.send_apdu_constr_checksw(self.cla_byte, '44', '00', '00', None, None, None)
|
||||||
|
|
||||||
def reset_card(self):
|
def reset_card(self):
|
||||||
"""Physically reset the card"""
|
"""Physically reset the card"""
|
||||||
return self._tp.reset_card()
|
return self._tp.reset_card()
|
||||||
|
|||||||
Reference in New Issue
Block a user