Avoid using deprecated OpenSSL functions
This commit is contained in:
parent
facfc879b5
commit
2e2c3ba4fc
|
@ -49,16 +49,8 @@ void clean()
|
||||||
*/
|
*/
|
||||||
Sha256Sum computeSha256Sum(const unsigned char *buffer, std::size_t size)
|
Sha256Sum computeSha256Sum(const unsigned char *buffer, std::size_t size)
|
||||||
{
|
{
|
||||||
// init sha256 hashing
|
auto hash = Sha256Sum();
|
||||||
SHA256_CTX sha256;
|
SHA256(buffer, size, hash.data);
|
||||||
SHA256_Init(&sha256);
|
|
||||||
|
|
||||||
// do the actual hashing
|
|
||||||
SHA256_Update(&sha256, buffer, size);
|
|
||||||
|
|
||||||
// finalize the hashing
|
|
||||||
Sha256Sum hash;
|
|
||||||
SHA256_Final(hash.data, &sha256);
|
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue