This prevents link errors with the openbsd-compat tests when the linker
tries to bring in all the logging bits.
unsigned char buf[RANDOM_SEED_SIZE];
/* Initialise libcrypto */
- ssh_libcrypto_init();
+ if (ssh_libcrypto_init() != 1)
+ fatal("libcrypto failed to initialize.");
if (!ssh_compatible_openssl(OPENSSL_VERSION_NUMBER,
OpenSSL_version_num()))
return 0;
}
-void
+int
ssh_libcrypto_init(void)
{
uint64_t opts = OPENSSL_INIT_ADD_ALL_CIPHERS |
opts |= OPENSSL_INIT_LOAD_CONFIG;
#endif /* USE_OPENSSL_ENGINE */
- if (OPENSSL_init_crypto(opts, NULL) != 1)
- fatal("OPENSSL_init_crypto failed");
+ return OPENSSL_init_crypto(opts, NULL);
}
#ifndef HAVE_EVP_DIGESTSIGN
#include <openssl/dh.h>
int ssh_compatible_openssl(long, long);
-void ssh_libcrypto_init(void);
+int ssh_libcrypto_init(void);
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
# error OpenSSL 1.1.0 or greater is required