diff mbox

pySim current master fails for sysmosim-gr1

Message ID 20161018095734.GA1521@ass40.sysmocom.de
State New
Headers show

Commit Message

Neels Hofmeyr Oct. 18, 2016, 9:57 a.m. UTC
On Tue, Oct 18, 2016 at 11:23:42AM +0200, Holger Freyther wrote:
> 
> > On 17 Oct 2016, at 19:27, Ivaylo Kostov <ikostov@sysmocom.de> wrote:
> > 
> >> ./pySim-read.py -p 0
> >> Reading ...
> >> Traceback (most recent call last):
> >>  File "./pySim-read.py", line 90, in <module>
> >>    (res, sw) = scc.read_binary(['3f00', '2fe2'])
> >>  File "/home/wirelesss/net/pysim/pySim/commands.py", line 51, in read_binary
> >>    r = self.select_file(ef)
> >>  File "/home/wirelesss/net/pysim/pySim/commands.py", line 44, in select_file
> >>    data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000C02" + i)
> >>  File "/home/wirelesss/net/pysim/pySim/transport/__init__.py", line 87, in send_apdu_checksw
> >>    raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1]))
> >> RuntimeError: SW match failed ! Expected 9000 and got 6b00.
> 
> I think master has issues with the GR1 card, e.g. try e9e5ecbe3068dae7e6e0959f22ed1855911dc892
> 
> holger

I can confirm: current pySim master fails for sysmosim-gr1.

My local pySim clone was still on the revision before that, which works
like a charm. As soon as I pulled the latest master, I got the same error
as Ivo, also confirmed by Max.

It looks like we should revert this commit, and/or make it configurable by a
command line option that is off by default, or maybe depend this on the SIM type in use?


commit 8c1b33c439fef423c3536e9243035722c52aba4c
Refs: {origin/HEAD}, {origin/master}, {origin/zecke/tmp}
Author:     Jan Balke <jan@corenetdynamics.com>
AuthorDate: Mon Jan 26 11:18:28 2015 +0100
Commit:     Harald Welte <laforge@gnumonks.org>
CommitDate: Thu Aug 20 13:32:56 2015 +0200

    Do not return the FCI information while selecting a file

    The sysmoUSIM-SJS1 card does not support returning the FCI
    information.
    Plus, the FCI information are not used anyway.
---
 pySim/commands.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Neels Hofmeyr Oct. 19, 2016, 12:12 p.m. UTC | #1
--> https://osmocom.org/issues/1828

On Tue, Oct 18, 2016 at 11:57:34AM +0200, Neels Hofmeyr wrote:
> > >> RuntimeError: SW match failed ! Expected 9000 and got 6b00.
diff mbox

Patch

diff --git a/pySim/commands.py b/pySim/commands.py
index cb72a11..721b3d4 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -41,7 +41,7 @@  class SimCardCommands(object):
        def select_file(self, dir_list):
                rv = []
                for i in dir_list:
-                       data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000002" + i)
+                       data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4000C02" + i)
                        rv.append(data)
                return rv