From 2e2c3ba4fcbbcf8ba12e31d94dd50f7d5c7b3ede Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 3 Nov 2022 22:29:08 +0100 Subject: [PATCH] Avoid using deprecated OpenSSL functions --- util/openssl.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/util/openssl.cpp b/util/openssl.cpp index e65c648..bd5d3ca 100644 --- a/util/openssl.cpp +++ b/util/openssl.cpp @@ -49,16 +49,8 @@ void clean() */ Sha256Sum computeSha256Sum(const unsigned char *buffer, std::size_t size) { - // init sha256 hashing - SHA256_CTX sha256; - SHA256_Init(&sha256); - - // do the actual hashing - SHA256_Update(&sha256, buffer, size); - - // finalize the hashing - Sha256Sum hash; - SHA256_Final(hash.data, &sha256); + auto hash = Sha256Sum(); + SHA256(buffer, size, hash.data); return hash; }