diff options
Diffstat (limited to 'openbsd-compat/openssl-compat.c')
-rw-r--r-- | openbsd-compat/openssl-compat.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c index 5ade8f0ba..d8c00ebcb 100644 --- a/openbsd-compat/openssl-compat.c +++ b/openbsd-compat/openssl-compat.c | |||
@@ -66,26 +66,31 @@ ssh_compatible_openssl(long headerver, long libver) | |||
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
68 | 68 | ||
69 | #ifdef USE_OPENSSL_ENGINE | ||
70 | void | 69 | void |
71 | ssh_OpenSSL_add_all_algorithms(void) | 70 | ssh_libcrypto_init(void) |
72 | { | 71 | { |
72 | #if defined(HAVE_OPENSSL_ADD_ALL_ALGORITHMS) | ||
73 | OpenSSL_add_all_algorithms(); | 73 | OpenSSL_add_all_algorithms(); |
74 | #elif defined(HAVE_OPENSSL_INIT_CRYPTO) && \ | ||
75 | defined(OPENSSL_INIT_ADD_ALL_CIPHERS) && \ | ||
76 | defined(OPENSSL_INIT_ADD_ALL_DIGESTS) | ||
77 | OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | | ||
78 | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL); | ||
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 defined(HAVE_OPENSSL_INIT_CRYPTO) && \ | 86 | /* Load the libcrypto config file to pick up engines defined there */ |
80 | defined(OPENSSL_INIT_ADD_ALL_CIPHERS) && \ | 87 | # if defined(HAVE_OPENSSL_INIT_CRYPTO) && defined(OPENSSL_INIT_LOAD_CONFIG) |
81 | defined(OPENSSL_INIT_ADD_ALL_DIGESTS) && \ | ||
82 | defined(OPENSSL_INIT_LOAD_CONFIG) | ||
83 | OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | | 88 | OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS | |
84 | OPENSSL_INIT_ADD_ALL_DIGESTS | OPENSSL_INIT_LOAD_CONFIG, NULL); | 89 | OPENSSL_INIT_ADD_ALL_DIGESTS | OPENSSL_INIT_LOAD_CONFIG, NULL); |
85 | #else | 90 | # else |
86 | OPENSSL_config(NULL); | 91 | OPENSSL_config(NULL); |
87 | #endif | 92 | # endif |
93 | #endif /* USE_OPENSSL_ENGINE */ | ||
88 | } | 94 | } |
89 | #endif | ||
90 | 95 | ||
91 | #endif /* WITH_OPENSSL */ | 96 | #endif /* WITH_OPENSSL */ |