diff options
author | cuongdt1994 <63875204+cuongdt1994@users.noreply.github.com> | 2023-06-06 03:19:49 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 03:19:49 +0700 |
commit | 2a36205840072ec51a7166d23298491a90164d63 (patch) | |
tree | 6cf3734610adf2889347e39fa4d0abae27aa8679 | |
parent | 12b7da289665c75c3839b32c77a491d8909f3e73 (diff) | |
download | vyos-1x-2a36205840072ec51a7166d23298491a90164d63.tar.gz vyos-1x-2a36205840072ec51a7166d23298491a90164d63.zip |
Don't use deprecated crypt module.
-rwxr-xr-x | src/conf_mode/vpn_openconnect.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/vpn_openconnect.py b/src/conf_mode/vpn_openconnect.py index 83021a3e6..dd347eb03 100755 --- a/src/conf_mode/vpn_openconnect.py +++ b/src/conf_mode/vpn_openconnect.py @@ -30,7 +30,7 @@ from vyos.util import is_listen_port_bind_service from vyos.util import dict_search from vyos.xml import defaults from vyos import ConfigError -from crypt import crypt, mksalt, METHOD_SHA512 +from passlib.hash import sha512_crypt from time import sleep from vyos import airbag @@ -45,7 +45,8 @@ radius_servers = cfg_dir + '/radius_servers' # Generate hash from user cleartext password def get_hash(password): - return crypt(password, mksalt(METHOD_SHA512)) + return sha512_crypt.hash("password") + def _default_dict_cleanup(origin: dict, default_values: dict) -> dict: |