summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/tsig-openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nsd/tsig-openssl.c')
-rw-r--r--usr.sbin/nsd/tsig-openssl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/nsd/tsig-openssl.c b/usr.sbin/nsd/tsig-openssl.c
index 62203dc3525..f38284edfa5 100644
--- a/usr.sbin/nsd/tsig-openssl.c
+++ b/usr.sbin/nsd/tsig-openssl.c
@@ -61,7 +61,11 @@ int
tsig_openssl_init(region_type *region)
{
int count = 0;
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO)
OpenSSL_add_all_digests();
+#else
+ OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
+#endif
count += tsig_openssl_init_algorithm(region,
"md5", "hmac-md5","hmac-md5.sig-alg.reg.int.");
@@ -137,7 +141,9 @@ final(void *context, uint8_t *digest, size_t *size)
void
tsig_openssl_finalize()
{
+#ifdef HAVE_EVP_CLEANUP
EVP_cleanup();
+#endif
}
#endif /* defined(HAVE_SSL) */