From 6e7e0c01e3a7d21f77f18aeaef11e33531ce460b Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 3 Nov 2022 22:34:31 +0100 Subject: [PATCH] Avoid using deprecated OpenSSL functions --- librepomgr/authentication.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/librepomgr/authentication.cpp b/librepomgr/authentication.cpp index b4183af..08b5bd6 100644 --- a/librepomgr/authentication.cpp +++ b/librepomgr/authentication.cpp @@ -89,11 +89,8 @@ UserAuth ServiceSetup::Authentication::authenticate(std::string_view authorizati } // hash password - SHA512_CTX sha512; - SHA512_Init(&sha512); - SHA512_Update(&sha512, password.data(), password.size()); unsigned char hash[SHA512_DIGEST_LENGTH]; - SHA512_Final(hash, &sha512); + SHA512(reinterpret_cast(password.data()), password.size(), hash); // check whether password hash matches auto i = user->second.passwordSha512.cbegin();