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.
--
- Vadim Yanitskiy <vyanitskiy at sysmocom.de>
http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte