From 9be0408ab809f9df5afae227e1b2fea466d1bc5f Mon Sep 17 00:00:00 2001 From: Christian Hagenest Date: Thu, 6 Jun 2024 00:05:40 +0200 Subject: [PATCH] replace crypt with hashlib --- chatmaild/src/chatmaild/doveauth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chatmaild/src/chatmaild/doveauth.py b/chatmaild/src/chatmaild/doveauth.py index 74e1f784..db1a7c7b 100644 --- a/chatmaild/src/chatmaild/doveauth.py +++ b/chatmaild/src/chatmaild/doveauth.py @@ -1,4 +1,4 @@ -import crypt +import hashlib import json import logging import os @@ -23,7 +23,7 @@ class UnknownCommand(ValueError): def encrypt_password(password: str): # https://doc.dovecot.org/configuration_manual/authentication/password_schemes/ - passhash = crypt.crypt(password, crypt.METHOD_SHA512) + passhash = hashlib.sha512(password).hexdigest() return "{SHA512-CRYPT}" + passhash