Call ENGINE_load_builtin_engines().
authorGuus Sliepen <guus@tinc-vpn.org>
Tue, 20 Jul 2021 22:04:08 +0000 (00:04 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 20 Jul 2021 22:04:08 +0000 (00:04 +0200)
As suggested by Rosen Penev, use ENGINE_load_builtin_engines() to ensure
the AFALG engines get loaded as well. We apparently also don't need to
call OPENSSL_init_crypto() ourself.

src/openssl/crypto.c

index 8fc7e77..7e020e6 100644 (file)
@@ -94,8 +94,7 @@ void randomize(void *out, size_t outlen) {
 void crypto_init(void) {
        random_init();
 
-       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);
+       ENGINE_load_builtin_engines();
 
        if(!RAND_status()) {
                fprintf(stderr, "Not enough entropy for the PRNG!\n");