X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fopenssl%2Fcrypto.c;h=fe5a599715c93c1c1317877bb45ab1d189af5087;hb=dff94d1df4228386ea9f523b1bfc37590ca31fd8;hp=7cfdbbaf30030b41d4c22fe6410453cc13325a81;hpb=2c6b2d70e6640f39563ad7bb0aa0ba87f883848c;p=tinc diff --git a/src/openssl/crypto.c b/src/openssl/crypto.c index 7cfdbbaf..fe5a5997 100644 --- a/src/openssl/crypto.c +++ b/src/openssl/crypto.c @@ -24,7 +24,7 @@ #include "../crypto.h" -#ifndef HAVE_MINGW +#ifndef HAVE_WINDOWS static int random_fd = -1; @@ -70,14 +70,14 @@ void randomize(void *vout, size_t outlen) { #include HCRYPTPROV prov; -void random_init(void) { +static void random_init(void) { if(!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { fprintf(stderr, "CryptAcquireContext() failed!\n"); abort(); } } -void random_exit(void) { +static void random_exit(void) { CryptReleaseContext(prov, 0); } @@ -93,7 +93,9 @@ void randomize(void *out, size_t outlen) { void crypto_init(void) { random_init(); +#if OPENSSL_VERSION_MAJOR < 3 ENGINE_load_builtin_engines(); +#endif if(!RAND_status()) { fprintf(stderr, "Not enough entropy for the PRNG!\n");