summaryrefslogtreecommitdiff
path: root/src/conf_mode/vpn_openconnect.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2023-06-06 00:01:03 +0100
committerGitHub <noreply@github.com>2023-06-06 00:01:03 +0100
commitc411bc349d053201802cbe6839b2283b28cee889 (patch)
tree59009fe532260d35e5bc5af6cd5189585d9ca1e4 /src/conf_mode/vpn_openconnect.py
parent47cce6805562c11b75ef9d5d761881e275d1a27d (diff)
parent65654946aa4577c753f66b2577119c74f2ba7777 (diff)
downloadvyos-1x-c411bc349d053201802cbe6839b2283b28cee889.tar.gz
vyos-1x-c411bc349d053201802cbe6839b2283b28cee889.zip
Merge pull request #2027 from cuongdt1994/patch-1
T5260: Do not use deprecated python crypt module
Diffstat (limited to 'src/conf_mode/vpn_openconnect.py')
-rwxr-xr-xsrc/conf_mode/vpn_openconnect.py5
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..3d5dc12a4 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: