Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unsupported operand type(s) for ^: 'int' and 'str' in packet.py #192

Open
liujing2048 opened this issue Feb 2, 2024 · 0 comments

Comments

@liujing2048
Copy link

hello, i am use python 3.6 and pyrad 2.4 In a docker environment
I use RADPERF (similar to RADClient in Freradius) tools for Pyrad to test the pressure test, and then there will be the following problems

radius-1 | Traceback (most recent call last):
radius-1 | File "main.py", line 4, in
radius-1 | start_socket()
radius-1 | File "/var/radius/mypyrad.py", line 238, in start_socket
radius-1 | srv.Run()
radius-1 | File "/usr/local/lib/python3.6/site-packages/pyrad/server.py", line 339, in Run
radius-1 | self._ProcessInput(fdo)
radius-1 | File "/usr/local/lib/python3.6/site-packages/pyrad/server.py", line 314, in _ProcessInput
radius-1 | self._HandleAuthPacket(pkt)
radius-1 | File "/usr/local/lib/python3.6/site-packages/pyrad/server.py", line 222, in _HandleAuthPacket
radius-1 | self.HandleAuthPacket(pkt)
radius-1 | File "/var/radius/mypyrad.py", line 85, in HandleAuthPacket
radius-1 | password = get_password(pkt)
radius-1 | File "/var/radius/mypyrad.py", line 53, in get_password
radius-1 | return pkt.PwDecrypt(pkt['Password'][0]) # pap
radius-1 | File "/usr/local/lib/python3.6/site-packages/pyrad/packet.py", line 712, in PwDecrypt
radius-1 | pw += bytes((hash[i] ^ buf[i],))
radius-1 | TypeError: unsupported operand type(s) for ^: 'int' and 'str'

What I want to add is:
1)During the test, the command used is:
echo "User-Name = user_test,User-Password = 123" | radperf -c 3000 -x -s 192.168.88.101:1812 auth vpdn
2)Not every test will occur, but the chance of appearing is very high

How can I fix this error myself? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant