]> git.ipfire.org Git - thirdparty/openssl.git/commit
Allow for reuse of thread_local keys in threads_none
authorNeil Horman <nhorman@openssl.org>
Thu, 5 Jun 2025 12:25:52 +0000 (08:25 -0400)
committerNeil Horman <nhorman@openssl.org>
Fri, 6 Jun 2025 17:49:39 +0000 (13:49 -0400)
commitb6d01d1b1fef2e98a956b7ba4e8443cf7d916dcb
treea7e919b114e2a69be6a8028ed070c19b0d05b16d
parent07c772847de682412448daea07582f566d30f7ac
Allow for reuse of thread_local keys in threads_none

If openssl is configured with no-threads, the implementation has a hard
limit of 256 LIB_CTX values, as each LIB_CTX allocates a thread local
key, and we never reuse them (like libc does when using
pthread_key_create/destroy.

Improve the situation by allowing for marking freed keys as unsued and
searching for an available key when allocating

Fixes #27757

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27775)
crypto/threads_none.c