openssl: Remove unused openssl_hash_chunk() helper

Was used by the ECDSA implementation before 293a912c7d ("openssl: Fixes
for ECDSA with OpenSSL 3.0").
This commit is contained in:
Tobias Brunner
2022-10-05 18:15:26 +02:00
parent 4ea61dcbfe
commit c58ba0cb9f
2 changed files with 0 additions and 57 deletions
@@ -129,51 +129,6 @@ bool openssl_fingerprint(EVP_PKEY *key, cred_encoding_type_t type, chunk_t *fp)
return TRUE;
}
/**
* Described in header.
*/
bool openssl_hash_chunk(int hash_type, chunk_t data, chunk_t *hash)
{
EVP_MD_CTX *ctx;
bool ret = FALSE;
const EVP_MD *hasher = EVP_get_digestbynid(hash_type);
if (!hasher)
{
return FALSE;
}
ctx = EVP_MD_CTX_create();
if (!ctx)
{
goto error;
}
if (!EVP_DigestInit_ex(ctx, hasher, NULL))
{
goto error;
}
if (!EVP_DigestUpdate(ctx, data.ptr, data.len))
{
goto error;
}
*hash = chunk_alloc(EVP_MD_size(hasher));
if (!EVP_DigestFinal_ex(ctx, hash->ptr, NULL))
{
chunk_free(hash);
goto error;
}
ret = TRUE;
error:
if (ctx)
{
EVP_MD_CTX_destroy(ctx);
}
return ret;
}
/**
* Described in header.
*/