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

Unable to import FreeRADIUS dictionaries #173

Open
pandafy opened this issue Oct 31, 2022 · 1 comment
Open

Unable to import FreeRADIUS dictionaries #173

pandafy opened this issue Oct 31, 2022 · 1 comment

Comments

@pandafy
Copy link

pandafy commented Oct 31, 2022

I am invoking the client with the following code

from pyrad.dictionary import Dictionary
from pyrad.client import Client

client = Client(server="192.168.1.1", secret=b"test", dict=Dictionary("/usr/share/freeradius/dictionary"))

And I get following error

pyrad.dictionary.ParseError: dictionary.rfc2865(35): Parse error: Illegal type: vsa

I changed the source code to report all the data types that are not supported in pyrad and found that these data types are not supported.

File Name Data Type
/usr/share/freeradius/dictionary.rfc2865 vsa
/usr/share/freeradius/dictionary.rfc6572 ipv4prefix
/usr/share/freeradius/dictionary.rfc6929 extended
/usr/share/freeradius/dictionary.rfc6929 long-extended
/usr/share/freeradius/dictionary.rfc6929 evs

It appears that all of these data types are part of some RFC, Maybe, they should be added to pyrad.dictionary.DATATYPES?

@pandafy
Copy link
Author

pandafy commented Oct 31, 2022

After updating the code to add these datatypes, I get the following error:

Traceback (most recent call last):
  File "test.py", line 5, in <module>
    client = Client(server="192.168.1.1", secret=b"test", dict=Dictionary("/usr/share/freeradius/dictionary"))
  File "/home/pandafy/openwisp/venv-subscription/lib/python3.8/site-packages/pyrad/dictionary.py", line 165, in __init__
    self.ReadDictionary(dict)
  File "/home/pandafy/openwisp/venv-subscription/lib/python3.8/site-packages/pyrad/dictionary.py", line 389, in ReadDictionary
    self.__ParseAttribute(state, tokens)
  File "/home/pandafy/openwisp/venv-subscription/lib/python3.8/site-packages/pyrad/dictionary.py", line 272, in __ParseAttribute
    state['tlvs'][parent_code].sub_attributes[code] = attribute
KeyError: 241

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