From patchwork Tue Oct 18 09:57:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neels Hofmeyr X-Patchwork-Id: 683607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3syr9v1QTXz9s9x for ; Tue, 18 Oct 2016 20:58:27 +1100 (AEDT) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id A2AD72099B; Tue, 18 Oct 2016 09:58:25 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [IPv6:2001:bf0:c000::1:8]) by lists.osmocom.org (Postfix) with ESMTP id 51D122097D for ; Tue, 18 Oct 2016 09:57:38 +0000 (UTC) X-Envelope-From: nhofmeyr@sysmocom.de Received: from ass40.sysmocom.de (ip5b418559.dynamic.kabel-deutschland.de [91.65.133.89]) (authenticated bits=128) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-8+deb8u1) with ESMTP id u9I9vYq9017109 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Oct 2016 11:57:34 +0200 Date: Tue, 18 Oct 2016 11:57:34 +0200 From: Neels Hofmeyr To: openbsc@lists.osmocom.org, Jan Balke Subject: pySim current master fails for sysmosim-gr1 Message-ID: <20161018095734.GA1521@ass40.sysmocom.de> References: <379defbc-47a2-11f2-d1ff-2c7dd636e063@sysmocom.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" On Tue, Oct 18, 2016 at 11:23:42AM +0200, Holger Freyther wrote: > > > On 17 Oct 2016, at 19:27, Ivaylo Kostov wrote: > > > >> ./pySim-read.py -p 0 > >> Reading ... > >> Traceback (most recent call last): > >> File "./pySim-read.py", line 90, in > >> (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 AuthorDate: Mon Jan 26 11:18:28 2015 +0100 Commit: Harald Welte 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(-) 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