From 27feda0436e39e04ae53e08247739f8b6c906d56 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 25 Oct 2022 09:02:05 -0700 Subject: [PATCH] Call `OpenSSL_add_all_algorithms()` on older openssl versions. --- checksum.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/checksum.c b/checksum.c index 60de3655..c6007f36 100644 --- a/checksum.c +++ b/checksum.c @@ -154,7 +154,7 @@ static const EVP_MD *csum_evp_md(struct name_num_item *nni) emd = NULL; else #endif - emd = EVP_get_digestbyname(nni->name); + emd = EVP_get_digestbyname(nni->name); if (emd && !(nni->flags & NNI_EVP_OK)) { /* Make sure it works before we advertise it */ if (!ctx_evp && !(ctx_evp = EVP_MD_CTX_create())) out_of_memory("csum_evp_md"); @@ -787,6 +787,10 @@ void init_checksum_choices() if (initialized_choices) return; +#if defined USE_OPENSSL && OPENSSL_VERSION_NUMBER < 0x10100000L + OpenSSL_add_all_algorithms(); +#endif + #if defined SUPPORT_XXH3 || defined USE_OPENSSL for (nni = valid_checksums.list; nni->name; nni++) verify_digest(nni, True); -- 2.34.1