adapt ro new Python version

This commit is contained in:
Joerg Lehmann 2022-10-21 15:19:26 +02:00
parent d2c08b6390
commit 58b7e59e52
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ if not password:
file = open('/opt/openvpn/users/'+username+'.pwd', 'r')
hashed=file.read().rstrip()
if bcrypt.hashpw(password, hashed) == hashed:
if bcrypt.hashpw(password.encode('utf-8'), hashed.encode('utf-8')) == hashed.encode('utf-8'):
sys.exit(0)
else:
sys.exit(1)