summaryrefslogtreecommitdiff
path: root/openbsd-compat/openssl-compat.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2018-10-16 10:51:52 +1100
committerDamien Miller <djm@mindrot.org>2018-10-16 10:54:37 +1100
commit4e23deefd7959ef83c73ed9cce574423438f6133 (patch)
tree4b0c368f5c29f03a1ebed5f4f9315b5a303c3a78 /openbsd-compat/openssl-compat.c
parent797cdd9c8468ed1125ce60d590ae3f1397866af4 (diff)
Avoid deprecated OPENSSL_config when using 1.1.x
OpenSSL 1.1.x soft-deprecated OPENSSL_config in favour of OPENSSL_init_crypto; pointed out by Jakub Jelen
Diffstat (limited to 'openbsd-compat/openssl-compat.c')
-rw-r--r--openbsd-compat/openssl-compat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c
index 259fccbe..762358f0 100644
--- a/openbsd-compat/openssl-compat.c
+++ b/openbsd-compat/openssl-compat.c
@@ -75,7 +75,13 @@ ssh_OpenSSL_add_all_algorithms(void)
/* Enable use of crypto hardware */
ENGINE_load_builtin_engines();
ENGINE_register_all_complete();
+
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
OPENSSL_config(NULL);
+#else
+ OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS |
+ OPENSSL_INIT_ADD_ALL_DIGESTS | OPENSSL_INIT_LOAD_CONFIG);
+#endif
}
#endif