Skip to content

Commit 98ae04a

Browse files
disable keyinuse if locks are not created
1 parent ad82111 commit 98ae04a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

KeysInUse/keysinuse.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ static void keysinuse_atfork_reinit()
383383
keysinuse_log_error("Failed to lock keysinuse context hash table in fork handler,OPENSSL_%d", ERR_get_error());
384384
}
385385

386-
// Only recreate logging thread if it was running in the parent process
387-
if (is_parent_logging && is_parent_running)
386+
// Only recreate logging thread if it was running in the parent process and keysinuse is enabled
387+
if (is_parent_logging && is_parent_running && keysinuse_enabled)
388388
{
389389
// Start the logging thread. Monotonic clock needs to be set to
390390
// prevent wall clock changes from affecting the logging delay sleep time
@@ -780,6 +780,7 @@ static void keysinuse_reset_key_ctx(SCOSSL_KEYSINUSE_CTX_IMP *ctx)
780780
ctx->lock = CRYPTO_THREAD_lock_new();
781781
if (ctx->lock == NULL)
782782
{
783+
keysinuse_enabled = FALSE;
783784
keysinuse_log_error("Failed to create keysinuse context lock in fork handler");
784785
return;
785786
}

0 commit comments

Comments
 (0)