]> git.feebdaed.xyz Git - 0xmirror/strongswan.git/commit
revocation: Synchronize CRL fetches of multiple threads to the same URL
authorMartin Willi <martin@strongswan.org>
Wed, 29 Oct 2025 08:48:31 +0000 (09:48 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 13 Nov 2025 17:15:15 +0000 (18:15 +0100)
commit330a7d1963032d03b8eae32e86346b99dc826b26
tree16a49e5921f45b147b515f4b03d355029db3ba2a
parent119dfc2c38a07fb73953faec73b39e80e9e8807f
revocation: Synchronize CRL fetches of multiple threads to the same URL

When handling many connection attempts from peers using the same CA, a slow
or non-responsive CRL distribution point can lead to concurrent fetches of
the same CRL by multiple threads. This is not only inefficient, but results
in all threads blocking for the full fetch timeout, potentially blocking
all threads in the pool.

As a first step, synchronize CRL fetches using a global mutex and a per-URL
condvar, so threads can wait for the CRL if another is already fetching it.
This reduces the number of useless concurrent CRL fetches, and allows threads
joining the party late to get blocked only until the first fetch completes
or times out.

The URL entry is preserved in the hashtable after completing the fetch.
This will allow subsequent optimizations to store the last fetch result
and act accordingly. The CRL itself is not, as CRLs can be rather large
and caching them can be done using existing mechanisms controlled via
corresponding options.
src/libstrongswan/plugins/revocation/revocation_fetcher.c