From 20f76c83f8817d98512055e6b373f3bbf8069c42 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Sat, 25 Jan 2025 01:00:28 +0100 Subject: [PATCH] replace deprecated crypt package with crypt-r --- chatmaild/pyproject.toml | 1 + chatmaild/src/chatmaild/doveauth.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chatmaild/pyproject.toml b/chatmaild/pyproject.toml index 1fa8a774..079b4bc3 100644 --- a/chatmaild/pyproject.toml +++ b/chatmaild/pyproject.toml @@ -12,6 +12,7 @@ dependencies = [ "deltachat-rpc-client", "filelock", "requests", + "crypt-r", ] [tool.setuptools] diff --git a/chatmaild/src/chatmaild/doveauth.py b/chatmaild/src/chatmaild/doveauth.py index ecaee00a..7aed3b52 100644 --- a/chatmaild/src/chatmaild/doveauth.py +++ b/chatmaild/src/chatmaild/doveauth.py @@ -1,9 +1,10 @@ -import crypt import json import logging import os import sys +import crypt_r + from .config import Config, read_config from .dictproxy import DictProxy from .migrate_db import migrate_from_db_to_maildir @@ -13,7 +14,7 @@ NOCREATE_FILE = "/etc/chatmail-nocreate" def encrypt_password(password: str): # https://doc.dovecot.org/configuration_manual/authentication/password_schemes/ - passhash = crypt.crypt(password, crypt.METHOD_SHA512) + passhash = crypt_r.crypt(password, crypt_r.METHOD_SHA512) return "{SHA512-CRYPT}" + passhash