diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/openssl.c b/src/openssl.c index 1b11207..cb4bd48 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -10371,9 +10371,12 @@ int luaopen__openssl_des(lua_State *L) { | |||
10371 | } /* luaopen__openssl_des() */ | 10371 | } /* luaopen__openssl_des() */ |
10372 | 10372 | ||
10373 | 10373 | ||
10374 | #if !OPENSSL_PREREQ(1,1,0) | ||
10374 | /* | 10375 | /* |
10375 | * Multithread Reentrancy Protection | 10376 | * Multithread Reentrancy Protection |
10376 | * | 10377 | * |
10378 | * Pre-1.0.2, OpenSSL needs to be given locking primitives | ||
10379 | * | ||
10377 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | 10380 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
10378 | 10381 | ||
10379 | static struct { | 10382 | static struct { |
@@ -10470,15 +10473,19 @@ epilog: | |||
10470 | return error; | 10473 | return error; |
10471 | } /* mt_init() */ | 10474 | } /* mt_init() */ |
10472 | 10475 | ||
10476 | #endif /* !OPENSSL_PREREQ(1,1,0) */ | ||
10477 | |||
10473 | 10478 | ||
10474 | static void initall(lua_State *L) { | 10479 | static void initall(lua_State *L) { |
10475 | static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; | 10480 | static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; |
10476 | static int initssl; | 10481 | static int initssl; |
10477 | int error; | 10482 | int error = 0; |
10478 | 10483 | ||
10479 | pthread_mutex_lock(&mutex); | 10484 | pthread_mutex_lock(&mutex); |
10480 | 10485 | ||
10481 | error = mt_init(); | 10486 | #if !OPENSSL_PREREQ(1,1,0) |
10487 | if (!error) | ||
10488 | error = mt_init(); | ||
10482 | 10489 | ||
10483 | if (!error && !initssl) { | 10490 | if (!error && !initssl) { |
10484 | initssl = 1; | 10491 | initssl = 1; |
@@ -10493,6 +10500,7 @@ static void initall(lua_State *L) { | |||
10493 | */ | 10500 | */ |
10494 | OPENSSL_config(NULL); | 10501 | OPENSSL_config(NULL); |
10495 | } | 10502 | } |
10503 | #endif | ||
10496 | 10504 | ||
10497 | if (!error) | 10505 | if (!error) |
10498 | error = compat_init(); | 10506 | error = compat_init(); |