util/sha256_openssl: fix libressl compat

This commit is contained in:
Andrei Alexeyev 2022-05-25 04:48:44 +03:00
parent 1358f35856
commit 00dca36a59
No known key found for this signature in database
GPG key ID: 72D26128040B9690

View file

@ -29,7 +29,9 @@ void sha256_update(SHA256State *st, const uint8_t *data, size_t len) {
void sha256_final(SHA256State *st, uint8_t hash[SHA256_BLOCK_SIZE], size_t hashlen) {
assert(hashlen >= SHA256_BLOCK_SIZE);
EVP_DigestFinalXOF((EVP_MD_CTX*)st, hash, hashlen);
uint osize = 0;
EVP_DigestFinal_ex((EVP_MD_CTX*)st, hash, &osize);
assert(osize == SHA256_BLOCK_SIZE);
}
void sha256_digest(const uint8_t *data, size_t len, uint8_t hash[SHA256_BLOCK_SIZE], size_t hashlen) {