X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fopenssl%2Fcrypto.c;h=8fc7e77b77750854bc9ec9743f608699832d3472;hb=b0b4a2f1eb3bef0141d817cbf3b575a5dd28f241;hp=5c7573602651ccbead9d63ed3c2a4765c686f407;hpb=ed070d754d1b5500b0ec3615ae342178cfd42efb;p=tinc diff --git a/src/openssl/crypto.c b/src/openssl/crypto.c index 5c757360..8fc7e77b 100644 --- a/src/openssl/crypto.c +++ b/src/openssl/crypto.c @@ -94,12 +94,8 @@ void randomize(void *out, size_t outlen) { void crypto_init(void) { random_init(); - ENGINE_load_builtin_engines(); - ENGINE_register_all_complete(); -#if OPENSSL_API_COMPAT < 0x10100000L - ERR_load_crypto_strings(); - OpenSSL_add_all_algorithms(); -#endif + uint64_t opts = OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS | OPENSSL_INIT_ENGINE_ALL_BUILTIN; + OPENSSL_init_crypto(opts, NULL); if(!RAND_status()) { fprintf(stderr, "Not enough entropy for the PRNG!\n"); @@ -108,10 +104,6 @@ void crypto_init(void) { } void crypto_exit(void) { -#if OPENSSL_API_COMPAT < 0x10100000L - EVP_cleanup(); - ERR_free_strings(); - ENGINE_cleanup(); -#endif + OPENSSL_cleanup(); random_exit(); }