hello,
i ran into an issue with osmo-sim-auth.
if i try ./osmo-sim-auth.py -r 00000000000000000000000000000000 -s
it says
Traceback (most recent call last): File "./osmo-sim-auth.py", line 27, in <module> from card.USIM import USIM File "/usr/src/osmo-sim-auth/card/USIM.py", line 56 print '[DBG] type definition: %s' % type(self) ^ SyntaxError: invalid syntax
do you know what the problem is? i think i installed pcsc-lite, pcscd and pyscard and dependencies.
thank you
Based on the traceback it seems to be a Python2/3 problem so try doing
python2 osmo-sim-auth.py
Cheers, Domi
18.04.2022 dátummal, 18:37 időpontban msfu msfu666@gmail.com írta:
hello,
i ran into an issue with osmo-sim-auth.
if i try ./osmo-sim-auth.py -r 00000000000000000000000000000000 -s
it says
Traceback (most recent call last): File "./osmo-sim-auth.py", line 27, in <module> from card.USIM import USIM File "/usr/src/osmo-sim-auth/card/USIM.py", line 56 print '[DBG] type definition: %s' % type(self) ^ SyntaxError: invalid syntax
do you know what the problem is? i think i installed pcsc-lite, pcscd and pyscard and dependencies.
thank you
i did, but again error message.
this is the output of python2 osmo-sim-auth.py -r 00000000000000000000000000000000 -s
Traceback (most recent call last): File "osmo-sim-auth.py", line 132, in <module> handle_sim(options, rand_bin) File "osmo-sim-auth.py", line 67, in handle_sim s = SIM() File "/usr/src/osmo-sim-auth/card/SIM.py", line 49, in __init__ ISO7816.__init__(self, CLA=0xA0) File "/usr/src/osmo-sim-auth/card/ICC.py", line 148, in __init__ cardtype = AnyCardType() File "/usr/local/lib/python2.7/dist-packages/smartcard/CardType.py", line 54, in __init__ super().__init__() TypeError: super() takes at least 1 argument (0 given)
what can i do?
cheers
On 4/18/22 18:28, Tomcsanyi, Domonkos wrote:
Based on the traceback it seems to be a Python2/3 problem so try doing
python2 osmo-sim-auth.py
Cheers, Domi
18.04.2022 dátummal, 18:37 időpontban msfu msfu666@gmail.com írta:
hello,
i ran into an issue with osmo-sim-auth.
if i try ./osmo-sim-auth.py -r 00000000000000000000000000000000 -s
it says
Traceback (most recent call last): File "./osmo-sim-auth.py", line 27, in <module> from card.USIM import USIM File "/usr/src/osmo-sim-auth/card/USIM.py", line 56 print '[DBG] type definition: %s' % type(self) ^ SyntaxError: invalid syntax
do you know what the problem is? i think i installed pcsc-lite, pcscd and pyscard and dependencies.
thank you
On 4/19/22 17:02, msfu wrote:
File "/usr/local/lib/python2.7/dist-packages/smartcard/CardType.py", line 54, in __init__ super().__init__() TypeError: super() takes at least 1 argument (0 given)
Looks like pyscard has dropped support for Python 2.7. I managed to reproduce this error in a virtual environment with pyscard v2.0.3:
$ virtualenv -p python2 /tmp/env $ source /tmp/env/bin/activate $ pip install pyscard $ pip list | grep pyscard pyscard 2.0.3
$ git clone git://git.osmocom.org/osmo-sim-auth $ cd osmo-sim-auth/ $ python2 ./osmo-sim-auth.py -s -r $(python -c "print ('ff' * 16)") Traceback (most recent call last): File "./osmo-sim-auth.py", line 125, in <module> handle_sim(options, rand_bin) File "./osmo-sim-auth.py", line 62, in handle_sim s= SIM() File "/tmp/osmo-sim-auth/card/SIM.py", line 49, in __init__ ISO7816.__init__(self, CLA=0xA0) File "/tmp/osmo-sim-auth/card/ICC.py", line 148, in __init__ cardtype = AnyCardType() File "/tmp/env/lib/python2.7/site-packages/smartcard/CardType.py", line 54, in __init__ super().__init__() TypeError: super() takes at least 1 argument (0 given)
This can be worked around by manually editing pyscard's CardType.py and changing 'super().__init__()' to 'CardType.__init__(self)':
$ sed -i "s/super().__init__()/CardType.__init__(self)/" \ /tmp/env/lib/python2.7/site-packages/smartcard/CardType.py $ python2 ./osmo-sim-auth.py -s -r $(python -c "print ('ff' * 16)") Testing SIM card with IMSI 901700000xxxxxx
GSM Authentication SRES: 52240393 Kc: 362c7f3a1da97800
But I would recommend using an older release:
$ pip uninstall pyscard $ pip install pyscard==2.0.0
IMO, osmo-sim-auth should be abandoned in favor of a command for running the authentication in pySim-shell (not yet implemented). This project is actively maintained and works with Python 3.
Best regards, Vadim.
On Thu, Apr 21, 2022 at 09:59:06PM +0300, Vadim Yanitskiy wrote:
On 4/19/22 17:02, msfu wrote:
File "/usr/local/lib/python2.7/dist-packages/smartcard/CardType.py", line 54, in __init__ super().__init__() TypeError: super() takes at least 1 argument (0 given)
Looks like pyscard has dropped support for Python 2.7. I managed to reproduce this error in a virtual environment with pyscard v2.0.3:
For your reference: pySim-shell is python3 code and supports UMTS-AKA in the ADF.USIM/ADF.ISIM.
So unless you need classic GSM authentication, you can use that much more powerful tool.
Hello msfu,
i ran into an issue with osmo-sim-auth.
if i try ./osmo-sim-auth.py -r 00000000000000000000000000000000 -s
Given that you are running osmo-sim-auth.py with -s option, your intent is to speak the classic GSM 11.11 SIM protocol to the card, rather than the newer USIM protocol, right? If your interest is indeed in the classic SIM protocol rather than USIM, you might like to check out my alternative C-language toolkit for talking to SIM cards:
https://www.freecalypso.org/hg/fc-sim-tools/
(Note that it's a Mercurial repository, not git - I'm old-fashioned.) I wrote my fc-sim-tools suite as an alternative to Osmocom SIM card tools because the latter are written in Python, and that's a language which I rather intensely dislike. My alternative toolkit is written in C instead. However, my current focus is on the classic GSM 11.11 SIM protocol, rather than USIM.
The following fc-simtool commands will do the equivalent of what you were trying to do with osmo-sim-auth.py
select gsm a38 00000000000000000000000000000000
HTH, M~