Skip to content

Commit

Permalink
Initialize OpenSSL before using it in hash_test
Browse files Browse the repository at this point in the history
Also, use the new API for initializing OpenSSL instead of the
deprecated one.
  • Loading branch information
vpodzime committed May 21, 2024
1 parent 1450dcb commit 481f93e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/unit/hash_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ void tests_setup()
initialized = 0;
return;
}

OPENSSL_init_crypto(0, NULL);
initialized = 1;

rsa = RSA_new();
if (rsa)
{
Expand All @@ -57,8 +61,6 @@ void tests_setup()
RSA_generate_key_ex(rsa, 1024, bn, NULL);
BN_free(bn);
}
OpenSSL_add_all_digests();
initialized = 1;
}

void tests_teardown()
Expand Down

0 comments on commit 481f93e

Please sign in to comment.