laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/35860?usp=email )


Change subject: pySim-shell: Fix regression in 'apdu' command on cards without 
profile
......................................................................

pySim-shell: Fix regression in 'apdu' command on cards without profile

Cards where no profile was detected don't have a logical channel, and
hence must use the raw APDU at all times.

Change-Id: I08e5d190bdb4e62ee808bfd77584cb3e0b85a8ae
Fixes: Change-Id Id0c364f772c31e11e8dfa21624d8685d253220d0
---
M pySim-shell.py
1 file changed, 14 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/35860/1

diff --git a/pySim-shell.py b/pySim-shell.py
index 89fdf6e..127e366 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -250,7 +250,7 @@
         # noted that the apdu command plays an exceptional role since it is 
the only card accessing command that
         # can be executed without the presence of a runtime state (self.rs) 
object. However, this also means that
         # self.lchan is also not present (see method equip).
-        if opts.raw:
+        if opts.raw or self.lchan is None:
             data, sw = self.card._scc.send_apdu(opts.APDU)
         else:
             data, sw = self.lchan.scc.send_apdu(opts.APDU)

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35860?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: I08e5d190bdb4e62ee808bfd77584cb3e0b85a8ae
Gerrit-Change-Number: 35860
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to