Hi,
I have a question.
When using osmocombb with C118, we are getting error when SIM tries to authenticate itself to the network. Here are the messages:
<0005> gsm48_mm.c:3902 (ms 1) Received 'RR_DATA_IND' from RR in state location updating initiated (sapi 0) <0005> gsm48_mm.c:4091 (ms 1) Received 'MT_MM_AUTH_REQ' in MM state location updating initiated <0005> gsm48_mm.c:1637 AUTHENTICATION REQUEST (seq 2) <0005> subscriber.c:955 Generating KEY at SIM <000f> sim.c:209 got new job: SIM_JOB_RUN_GSM_ALGO (handle=00000006) <000f> sim.c:697 go MF <000f> sim.c:241 SELECT (file=0x3f00) <000f> sim.c:187 sending APDU (class 0xa0, ins 0xa4) <000f> sim.c:876 received APDU (len=0 sw1=0x00 sw2=0x00) <000f> sim.c:952 command failed <000f> sim.c:151 sending result to callback function (type=1) <0005> subscriber.c:990 key generation on SIM failed (cause 2)
SIM is new. It works if you start phone without osmocom. And It also works if you start without osmocom and when SIM logs into network you restart the phone with osmocom. We tried several new cards and there was always same result. There is also no PIN set up (SIM is not locked). We tried with USIM. When we try old cards (>2 years old) osmocom works without problem.
Have you ever encountered this kind of trouble? Is there any fix for it?
Thank you.
Regards,
Alojzij
Hi,
SIM is new. It works if you start phone without osmocom. And It also works if you start without osmocom and when SIM logs into network you restart the phone with osmocom.
We tried several new cards and there was always same result. There is also no PIN set up (SIM is not locked). We tried with USIM.
When we try old cards (>2 years old) osmocom works without problem.
Have you ever encountered this kind of trouble? Is there any fix for it?
Interesting. Purely from the "symptoms", I'd guess that the sim starts in USIM mode and somehow needs to switch into SIM mode to work with plain old GSM. My understanding is that the SIM should do that on its own, but apparently doesn't. And then when you start the official fw, it's properly switched to SIM mode and then you can start osmocom. (I guess maybe capacitors keep VCC high enough for the sim to survive a reboot ? altough it still should be reset).
Just a theory ... (and not a perfect one at that).
Do you have a simtrace to make captures of what's on the wire when talking to the original fw / osmocom and compare ? Can you spare a SIM ?
Cheers,
Sylvain
Hi,
we do not have simtrace. Yet. When we receive simtrace we will be able to read and update you with captures of what is on wire.
We can spare the SIM. It is a prepaid SIM. Why?
Regards,
Alojzij
-----Original Message----- From: Sylvain Munaut [mailto:246tnt@gmail.com] Sent: Thursday, April 05, 2012 2:16 PM To: Alojzij Sinur Cc: baseband-devel@lists.osmocom.org; Jaka Nemanic Subject: Re: key generation on SIM failed (cause 2)
Hi,
SIM is new. It works if you start phone without osmocom. And It also works if you start without osmocom and when SIM logs into network you restart the phone with osmocom.
We tried several new cards and there was always same result. There is also no PIN set up (SIM is not locked). We tried with USIM.
When we try old cards (>2 years old) osmocom works without problem.
Have you ever encountered this kind of trouble? Is there any fix for it?
Interesting. Purely from the "symptoms", I'd guess that the sim starts in USIM mode and somehow needs to switch into SIM mode to work with plain old GSM. My understanding is that the SIM should do that on its own, but apparently doesn't. And then when you start the official fw, it's properly switched to SIM mode and then you can start osmocom. (I guess maybe capacitors keep VCC high enough for the sim to survive a reboot ? altough it still should be reset).
Just a theory ... (and not a perfect one at that).
Do you have a simtrace to make captures of what's on the wire when talking to the original fw / osmocom and compare ? Can you spare a SIM ?
Cheers,
Sylvain
Hi,
we do not have simtrace. Yet. When we receive simtrace we will be able to read and update you with captures of what is on wire.
I guess you can find a card reader.
Try to generate a Kc with pySim with the script below : (uncomment the right transport serial/pcsc)
------ #!/usr/bin/env python
import sys
from pySim.commands import SimCardCommands
from pySim.transport.serial import SerialSimLink sl = SerialSimLink(device='/dev/ttyUSB0', baudrate=9600)
# from pySim.transport.pcsc import PcscSimLink # sl = PcscSimLink(0)
sc = SimCardCommands(sl) sc.reset_card()
print sc.select_file(['3f00', '7f20']) print sc.run_gsm('00112233445566778899aabbccddeeff') --------
We can spare the SIM. It is a prepaid SIM. Why?
As a last resort, if remote debug doesn't work you can ship one to me to investigate what makes it special. But we're not there yet.
Cheers,
Sylvain
BTW, in the logs, do any of the other SIM access work ? Because what fails in those log is the "go back to MF" part which should happen a lot of time before as well.
Cheers,
Sylvain
Hi.
We found a card reader but it is not working. We are waiting for a new one.
SIM works if there is no request for PIN or request from network for authentication. If there is a PIN or authentication request than it does not work.
Would it help if we would send you log files?
Regards,
Alojzij
-----Original Message----- From: Sylvain Munaut [mailto:246tnt@gmail.com] Sent: Thursday, April 05, 2012 2:42 PM To: Alojzij Sinur Cc: baseband-devel@lists.osmocom.org; Jaka Nemanic Subject: Re: key generation on SIM failed (cause 2)
BTW, in the logs, do any of the other SIM access work ? Because what fails in those log is the "go back to MF" part which should happen a lot of time before as well.
Cheers,
Sylvain
Hi.
We received SIMTRACE and made some traces. I attached them.
We tried to open it but there was no success with wireshark. Even with your plugin.
In both cases the phone was just turned on. PIN was disabled.
Please check if you see anything unusual in it.
Thank You.
Regards,
Alojzij.
-----Original Message----- From: Sylvain Munaut [mailto:246tnt@gmail.com] Sent: Thursday, April 05, 2012 2:42 PM To: Alojzij Sinur Cc: baseband-devel@lists.osmocom.org; Jaka Nemanic Subject: Re: key generation on SIM failed (cause 2)
BTW, in the logs, do any of the other SIM access work ? Because what fails in those log is the "go back to MF" part which should happen a lot of time before as well.
Cheers,
Sylvain
Hi Alozij,
sorry for the late response.
On Thu, Apr 26, 2012 at 06:51:58AM +0000, Alojzij Sinur wrote:
We tried to open it but there was no success with wireshark. Even with your plugin.
Thanks. It seems like there is mostly a problem in splitting the APDUs. So the trace seems to make sense if I look at the hexdump, but the simtrace program seems to be unable to separate the APDUs from each other.
In both cases the phone was just turned on. PIN was disabled.
Please check if you see anything unusual in it.
I don't really see anything unusual. But I think without being able to reproduce your setup (using the same model sim card + phone), it will be difficult to further analyze this problem.
Regards, Harald
Hi.
DO you have any idea why this SIM does not work with osmocon software?
We still had no success.
Thanks.
-----Original Message----- From: Alojzij Sinur Sent: Thursday, April 26, 2012 8:52 AM To: 'Sylvain Munaut' Cc: baseband-devel@lists.osmocom.org; Jaka Nemanic Subject: RE: key generation on SIM failed (cause 2)
Hi.
We received SIMTRACE and made some traces. I attached them.
We tried to open it but there was no success with wireshark. Even with your plugin.
In both cases the phone was just turned on. PIN was disabled.
Please check if you see anything unusual in it.
Thank You.
Regards,
Alojzij.
-----Original Message----- From: Sylvain Munaut [mailto:246tnt@gmail.com] Sent: Thursday, April 05, 2012 2:42 PM To: Alojzij Sinur Cc: baseband-devel@lists.osmocom.org; Jaka Nemanic Subject: Re: key generation on SIM failed (cause 2)
BTW, in the logs, do any of the other SIM access work ? Because what fails in those log is the "go back to MF" part which should happen a lot of time before as well.
Cheers,
Sylvain
baseband-devel@lists.osmocom.org