Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
972 views
in Technique[技术] by (71.8m points)

module - python plugin for freeradius can't seek Crypto library

When installing the python module, freeradius does not seek some libraries, specifically the py-crypto library in the pip list is present.

The Python script works well without encryption.

If I run the scrypt from the console, the all libraries are visible and the script is works Ok.

The line in the python script

from Crypto.Cipher import AES

have errors:

python_function_load - Module 'radius' not found
python_error_log:200, Exception type: <class 'ImportError'>, Exception value: /usr/local   /lib/python3.8/dist-packages/Crypto/Cipher/_AES.cpython-38-x86_64-linux-gnu.so: undefined symbol: PyExc_SystemError
python_error_log:218, full_backtrace: ['Traceback (most recent call last):
', '  File "/etc/freeradius/3.0/scripts/radius.py", line 15, in <module>
    from Crypto.Cipher import AES
', '  File "/usr/local/lib/python3.8/dist-packages/Crypto/Cipher/AES.py", line 50, in <module>
    from Crypto.Cipher import _AES
', 'ImportError: /usr/local/lib/python3.8/dist-packages/Crypto/Cipher/_AES.cpython-38-x86_64-linux-gnu.so: undefined symbol: PyExc_SystemError
']
python_function_load - Failed to import python function 'radius.authorize'
python_error_log:188, Unknown error

/etc/freeradius/3.0/radiusd.conf[78]: Instantiation failed for module "python3"

Config radius.conf python3 {

    python_path="/etc/freeradius/3.0/scripts/"

    module = "radius"
    mod_authorize = radius
    func_authorize = authorize

    mod_accounting = radius
    func_accounting = accounting

 }

python sys.path output:

sys.path ‘/usr/lib/python38.zip’,
 ‘/usr/lib/python3.8’,
 ‘/usr/lib/python3.8/lib-dynload’,
 ‘/usr/local/lib/python3.8/dist-packages’,
 ‘/usr/local/lib/python3.8/dist-packages/py_crypto-0.0.4-py3.8.egg’,
 ‘/usr/lib/python3/dist-packages’,
 ‘/etc/freeradius/3.0/scripts/’,
 ’/usr/local/lib/python3.8/dist-packages/
question from:https://stackoverflow.com/questions/65951995/python-plugin-for-freeradius-cant-seek-crypto-library

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...