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

Erro with unknown attribute #87

Open
marzsv opened this issue Aug 13, 2018 · 0 comments
Open

Erro with unknown attribute #87

marzsv opened this issue Aug 13, 2018 · 0 comments

Comments

@marzsv
Copy link
Contributor

marzsv commented Aug 13, 2018

A KeyError is generated when the server receives a packet with an attribute that does not exist in the dictionaries. In this case Chargeable-User-Identity (89).

 File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/server.py", line 339, in Run
    self._ProcessInput(fdo)
  File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/server.py", line 313, in _ProcessInput
    pkt = self._GrabPacket(lambda data, s=self: s.CreateAuthPacket(packet=data), fd)
  File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/server.py", line 269, in _GrabPacket
    pkt = pktgen(data)
  File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/server.py", line 313, in <lambda>
    pkt = self._GrabPacket(lambda data, s=self: s.CreateAuthPacket(packet=data), fd)
  File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/host.py", line 56, in CreateAuthPacket
    return packet.AuthPacket(dict=self.dict, **args)
  File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/packet.py", line 482, in __init__
    Packet.__init__(self, code, id, secret, authenticator, **attributes)
  File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/packet.py", line 95, in __init__
    self.DecodePacket(attributes['packet'])
  File "/Users/mario/.local/share/virtualenvs/circumference-57RY6xtI/lib/python3.5/site-packages/pyrad/packet.py", line 415, in DecodePacket
    elif self.dict.attributes[self._DecodeKey(key)].type == 'tlv':
KeyError: 89
marzsv added a commit to wowfi/pyrad that referenced this issue Aug 15, 2018
- Raises exception when attribute does not exist in dictionary.
- Method to check if a dictionary contains an attribute.
- Method to check the dictionary attribute type.
twschum added a commit to twschum/pyrad that referenced this issue Apr 5, 2019
======================================================================
ERROR: testDecodePacketWithUnknownAttribute (tests.testPacket.PacketTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/testPacket.py", line 337, in testDecodePacketWithUnknownAttribute
    six.b('\x01\x02\x00\x1b1234567890123456\x09\x07value'))
  File "/Users/user/pyrad/pyrad/packet.py", line 415, in DecodePacket
    elif self.dict.attributes[self._DecodeKey(key)].type == 'tlv':
KeyError: 9
twschum added a commit to deepfield/pyrad that referenced this issue Apr 11, 2019
======================================================================
ERROR: testDecodePacketWithUnknownAttribute (tests.testPacket.PacketTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/testPacket.py", line 337, in testDecodePacketWithUnknownAttribute
    six.b('\x01\x02\x00\x1b1234567890123456\x09\x07value'))
  File "/Users/user/pyrad/pyrad/packet.py", line 415, in DecodePacket
    elif self.dict.attributes[self._DecodeKey(key)].type == 'tlv':
KeyError: 9
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