X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fssl_init.c;h=bf3cd235c47882df9e368fa72bba14f3e6076095;hp=134aa00d546aae266777f81bb8de18d0c5499518;hb=a4625290c37193f77a04e73899e1c2fe176c4991;hpb=0fc32b0718ec210e03b6d8623d4819ed04615a1b diff --git a/ssl/ssl_init.c b/ssl/ssl_init.c index 134aa00d54..bf3cd235c4 100644 --- a/ssl/ssl_init.c +++ b/ssl/ssl_init.c @@ -301,8 +301,20 @@ static void ssl_library_stop(void) */ int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { - if (stopped) + static int stoperrset = 0; + + if (stopped) { + if (!stoperrset) { + /* + * We only ever set this once to avoid getting into an infinite + * loop where the error system keeps trying to init and fails so + * sets an error etc + */ + stoperrset = 1; + SSLerr(SSL_F_OPENSSL_INIT_SSL, ERR_R_INIT_FAIL); + } return 0; + } if (!OPENSSL_init_crypto(opts | OPENSSL_INIT_ADD_ALL_CIPHERS | OPENSSL_INIT_ADD_ALL_DIGESTS, settings))