Skip to content

Commit 85b1e25

Browse files
committed
Fix test_digest to correctly test the provider implementation
Before this commit, test_digest invoked the engine-based digest implementation in both test-digest-engine and test-digest-provider, so the provider path was not actually exercised.
1 parent 8afa92a commit 85b1e25

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test_digest.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,9 @@ static int do_test(const struct hash_testvec *tv)
826826
EVP_MAC *mac = NULL;
827827

828828
ERR_set_mark();
829-
T((md = (EVP_MD *)EVP_get_digestbyname(tv->algname))
830-
|| (md = EVP_MD_fetch(NULL, tv->algname, NULL))
831-
|| (mac = EVP_MAC_fetch(NULL, tv->algname, NULL)));
829+
T((md = EVP_MD_fetch(NULL, tv->algname, NULL))
830+
|| (mac = EVP_MAC_fetch(NULL, tv->algname, NULL))
831+
|| (md = (EVP_MD *)EVP_get_digestbyname(tv->algname)));
832832
ERR_pop_to_mark();
833833

834834
printf(cBLUE "Test %s: %s: " cNORM, tv->algname, tv->name);
@@ -889,8 +889,8 @@ static int do_synthetic_once(const struct hash_testvec *tv, unsigned int shifts)
889889
ibuf[shifts + len] = len & 0xff;
890890

891891
EVP_MD *dgst;
892-
T((dgst = (EVP_MD *)EVP_get_digestbyname(tv->algname))
893-
|| (dgst = EVP_MD_fetch(NULL, tv->algname, NULL)));
892+
T((dgst = EVP_MD_fetch(NULL, tv->algname, NULL))
893+
|| (dgst = (EVP_MD *)EVP_get_digestbyname(tv->algname)));
894894
if (dgst && warn_md_impl_is_expected(dgst)) {
895895
EVP_MD_free(dgst);
896896
return 1;

0 commit comments

Comments
 (0)