summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2022-10-25 09:02:05 -0700
committerWayne Davison <wayne@opencoder.net>2022-10-25 09:04:45 -0700
commit27feda0436e39e04ae53e08247739f8b6c906d56 (patch)
tree984c6c1a9429a09ca40c71d3c61a2847bd6989e8
parentbf96cd314c29c042a28399beac2c8b63b957967f (diff)
downloadrsync-27feda0436e39e04ae53e08247739f8b6c906d56.tar.gz
Call `OpenSSL_add_all_algorithms()` on older openssl versions.
-rw-r--r--checksum.c6
1 files changed, 5 insertions, 1 deletions
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);