laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36925?usp=email )
Change subject: pySim/commands: STATUS: Use indeterminate length Le/P3 == '00'
......................................................................
pySim/commands: STATUS: Use indeterminate length Le/P3 == '00'
Let's have the card tell us what the length is by indicating '00'
instead of stating 'FF'. This is better aligned with general practice
and won't break assumptions in other parts of the code like SCP
transport.
Change-Id: Ied63c6e1970e3dfc675da5e5f94579fbb06fea51
---
M pySim/commands.py
1 file changed, 15 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/commands.py b/pySim/commands.py
index 7b21faf..c0ac1d7 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -618,7 +618,7 @@
def status(self) -> ResTuple:
"""Execute a STATUS command as per TS 102 221 Section 11.1.2."""
- return self.send_apdu_checksw(self.cla4lchan('80') + 'F20000ff')
+ return self.send_apdu_checksw(self.cla4lchan('80') + 'F2000000')
def deactivate_file(self) -> ResTuple:
"""Execute DECATIVATE FILE command as per TS 102 221 Section 11.1.14."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36925?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ied63c6e1970e3dfc675da5e5f94579fbb06fea51
Gerrit-Change-Number: 36925
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36930?usp=email )
Change subject: CardKeyProvider: Implement support for column-based transport key encryption
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
this still needs documentation
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36930?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I13146a799448d03c681dc868aaa31eb78b7821ff
Gerrit-Change-Number: 36930
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Sun, 26 May 2024 17:23:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36925?usp=email )
Change subject: pySim/commands: STATUS: Use indeterminate length Le/P3 == '00'
......................................................................
pySim/commands: STATUS: Use indeterminate length Le/P3 == '00'
Let's have the card tell us what the length is by indicating '00'
instead of stating 'FF'. This is better aligned with general practice
and won't break assumptions in other parts of the code like SCP
transport.
Change-Id: Ied63c6e1970e3dfc675da5e5f94579fbb06fea51
---
M pySim/commands.py
1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/25/36925/1
diff --git a/pySim/commands.py b/pySim/commands.py
index 7b21faf..c0ac1d7 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -618,7 +618,7 @@
def status(self) -> ResTuple:
"""Execute a STATUS command as per TS 102 221 Section 11.1.2."""
- return self.send_apdu_checksw(self.cla4lchan('80') + 'F20000ff')
+ return self.send_apdu_checksw(self.cla4lchan('80') + 'F2000000')
def deactivate_file(self) -> ResTuple:
"""Execute DECATIVATE FILE command as per TS 102 221 Section 11.1.14."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36925?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ied63c6e1970e3dfc675da5e5f94579fbb06fea51
Gerrit-Change-Number: 36925
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36927?usp=email )
Change subject: runtime: Introduce an 'identity' dict for things like ATR, ICCID, EID
......................................................................
runtime: Introduce an 'identity' dict for things like ATR, ICCID, EID
This patch introduces the dict, as well as its first use for ATR storage
Change-Id: Ief5ceaf5afe82800e33da233573293527befd2f4
---
M pySim-shell.py
M pySim/runtime.py
2 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/27/36927/1
diff --git a/pySim-shell.py b/pySim-shell.py
index 127e366..e238e6a 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -761,7 +761,7 @@
"""Display information about the currently inserted card"""
self._cmd.poutput("Card info:")
self._cmd.poutput(" Name: %s" % self._cmd.card.name)
- self._cmd.poutput(" ATR: %s" % b2h(self._cmd.lchan.scc.get_atr()))
+ self._cmd.poutput(" ATR: %s" % self._cmd.rs.identity['ATR'])
self._cmd.poutput(" ICCID: %s" % self._cmd.iccid)
self._cmd.poutput(" Class-Byte: %s" % self._cmd.lchan.scc.cla_byte)
self._cmd.poutput(" Select-Ctrl: %s" % self._cmd.lchan.scc.sel_ctrl)
diff --git a/pySim/runtime.py b/pySim/runtime.py
index d873e20..3ef9b2d 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -49,6 +49,9 @@
self.lchan = {}
# the basic logical channel always exists
self.lchan[0] = RuntimeLchan(0, self)
+ # this is a dict of card identities which different parts of the code might populate,
+ # typically with something like ICCID, EID, ATR, ...
+ self.identity = {}
# make sure the class and selection control bytes, which are specified
# by the card profile are used
@@ -138,6 +141,8 @@
# select MF to reset internal state and to verify card really works
self.lchan[0].select('MF', cmd_app)
self.lchan[0].selected_adf = None
+ # store ATR as part of our card identies dict
+ self.identity['ATR'] = atr
return atr
def add_lchan(self, lchan_nr: int) -> 'RuntimeLchan':
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36927?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ief5ceaf5afe82800e33da233573293527befd2f4
Gerrit-Change-Number: 36927
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange