]> 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 18:13:06 +0000 (14:13 -0400)
commitae86027f965f2d895cc1ba4c1294b9f8ed4fb4d9
tree0e7bc0afb1ac10334de58f6d2f22bee526fef2b8
parenta4acf026ec92de423829d26f9988ef7f0d886c6f
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)

(cherry picked from commit b6d01d1b1fef2e98a956b7ba4e8443cf7d916dcb)
crypto/threads_none.c