Avoid using deprecated OpenSSL functions

This commit is contained in:
Martchus 2022-11-03 22:29:08 +01:00
parent facfc879b5
commit 2e2c3ba4fc
1 changed files with 2 additions and 10 deletions

View File

@ -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;
}