summaryrefslogtreecommitdiff
path: root/openbsd-compat/openssl-compat.c
diff options
context:
space:
mode:
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 */