Hallo zusammen,
wegen meines Versuch die pySim zu verwenden habe ich folgendes bekommen:
./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. $ ./pySim-read.py -p 1 Traceback (most recent call last): File "./pySim-read.py", line 78, in <module> sl = PcscSimLink(opts.pcsc_dev) File "/home/wirelesss/net/pysim/pySim/transport/pcsc.py", line 38, in __init__ self._reader = r[reader_number] IndexError: list index out of range Exception AttributeError: "'PcscSimLink' object has no attribute '_con'" in <bound method PcscSimLink.__del__ of <pySim.transport.pcsc.PcscSimLink object at 0x7f3dca255750>> ignored
wenn man ./pySim-prog.py gebe, dann das Ergebnis auch nicht so richtig ist.
./pySim-prog.py -p 0 -t sysmosim-gr1 -i 001640000000072 -c 001 -x 001 -y 64 -s 1791198229180000071 Insert card now (or CTRL-C to cancel) Generated card parameters :
Name : Magic SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000 ICCID : 1791198229180000071 MCC/MNC : 1/64 IMSI : 001640000000072 Ki : 895c5a0e9e5f635111d6c366ae8c957f OPC : a230dcc3c71c17019189a8be734f9c74 ACC : None
Programming ... Traceback (most recent call last): File "./pySim-prog.py", line 626, in <module> card.program(cp) File "/home/wirelesss/net/pysim/pySim/cards.py", line 274, in program r = self._scc.select_file(['3f00', '2fe2']) 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.
Kommando: pcsc_scan funktioniert reibungslos.
Grüße, Ivaylo
Dear Ivo,
openbsc@ is an English language mailing list. If you'd like to write in German, you can always send to sysmocom internally.
(I have answered this mail privately, offering another SIM card to test with.)
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
Hi Holger,
Thank you!
Ivaylo
On 10/18/2016 11:23 AM, 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
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(-)
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