summaryrefslogtreecommitdiff
path: root/openbsd-compat/openssl-compat.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2019-06-05 06:41:44 +0100
committerColin Watson <cjwatson@debian.org>2019-06-05 06:41:44 +0100
commit102062f825fb26a74295a1c089c00c4c4c76b68a (patch)
tree3db66bc8c8483cce66516dff36f6ef56065143d9 /openbsd-compat/openssl-compat.c
parent3d246f10429fc9a37b98eabef94fe8dc7c61002b (diff)
parentfd0fa130ecf06d7d092932adcd5d77f1549bfc8d (diff)
Import openssh_8.0p1.orig.tar.gz
Diffstat (limited to 'openbsd-compat/openssl-compat.c')
-rw-r--r--openbsd-compat/openssl-compat.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c
index 8b4a36274..a37ca61bf 100644
--- a/openbsd-compat/openssl-compat.c
+++ b/openbsd-compat/openssl-compat.c
@@ -66,23 +66,31 @@ ssh_compatible_openssl(long headerver, long libver)
66 return 0; 66 return 0;
67} 67}
68 68
69#ifdef USE_OPENSSL_ENGINE
70void 69void
71ssh_OpenSSL_add_all_algorithms(void) 70ssh_libcrypto_init(void)
72{ 71{
72#if defined(HAVE_OPENSSL_INIT_CRYPTO) && \
73 defined(OPENSSL_INIT_ADD_ALL_CIPHERS) && \
74 defined(OPENSSL_INIT_ADD_ALL_DIGESTS)
75 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS |
76 OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
77#elif defined(HAVE_OPENSSL_ADD_ALL_ALGORITHMS)
73 OpenSSL_add_all_algorithms(); 78 OpenSSL_add_all_algorithms();
79#endif
74 80
81#ifdef USE_OPENSSL_ENGINE
75 /* Enable use of crypto hardware */ 82 /* Enable use of crypto hardware */
76 ENGINE_load_builtin_engines(); 83 ENGINE_load_builtin_engines();
77 ENGINE_register_all_complete(); 84 ENGINE_register_all_complete();
78 85
79#if OPENSSL_VERSION_NUMBER < 0x10001000L 86 /* Load the libcrypto config file to pick up engines defined there */
80 OPENSSL_config(NULL); 87# if defined(HAVE_OPENSSL_INIT_CRYPTO) && defined(OPENSSL_INIT_LOAD_CONFIG)
81#else
82 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | 88 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS |
83 OPENSSL_INIT_ADD_ALL_DIGESTS | OPENSSL_INIT_LOAD_CONFIG, NULL); 89 OPENSSL_INIT_ADD_ALL_DIGESTS | OPENSSL_INIT_LOAD_CONFIG, NULL);
84#endif 90# else
91 OPENSSL_config(NULL);
92# endif
93#endif /* USE_OPENSSL_ENGINE */
85} 94}
86#endif
87 95
88#endif /* WITH_OPENSSL */ 96#endif /* WITH_OPENSSL */