mirror of
https://github.com/chatmail/relay.git
synced 2026-05-12 17:14:36 +00:00
replace crypt with hashlib
This commit is contained in:
committed by
missytake
parent
6b59b8be44
commit
9be0408ab8
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user