Avoid using deprecated OpenSSL functions

This commit is contained in:
Martchus 2022-11-03 22:34:31 +01:00
parent 407e3159e0
commit 6e7e0c01e3
1 changed files with 1 additions and 4 deletions

View File

@ -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<const unsigned char *>(password.data()), password.size(), hash);
// check whether password hash matches
auto i = user->second.passwordSha512.cbegin();