]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: ssl: Chain ckch instances in ca-file entries
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Fri, 19 Feb 2021 16:41:55 +0000 (17:41 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 17 May 2021 08:50:24 +0000 (10:50 +0200)
commit4458b9732d97d30aeb83fe02b6b767b1fc689a38
treedfd09a131cbbeb0c10a8fe8eda293a3209eaa69b
parent9f0c9360573bcd9f3c249fb91c42a8f06b091d7c
MEDIUM: ssl: Chain ckch instances in ca-file entries

Each ca-file entry of the tree will now hold a list of the ckch
instances that use it so that we can iterate over them when updating the
ca-file via a cli command. Since the link between the SSL contexts and
the CA file tree entries is only built during the ssl_sock_prepare_ctx
function, which are called after all the ckch instances are created, we
need to add a little post processing after each ssl_sock_prepare_ctx
that builds the link between the corresponding ckch instance and CA file
tree entries.
In order to manage the ca-file and ca-verify-file options, any ckch
instance can be linked to multiple CA file tree entries and any CA file
entry can link multiple ckch instances. This is done thanks to a
dedicated list of ckch_inst references stored in the CA file tree
entries over which we can iterate (during an update for instance). We
avoid having one of those instances go stale by keeping a list of
references to those references in the instances.
When deleting a ckch_inst, we can then remove all the ckch_inst_link
instances that reference it, and when deleting a cafile_entry, we
iterate over the list of ckch_inst reference and clear the corresponding
entry in their own list of ckch_inst_link references.
include/haproxy/ssl_ckch-t.h
include/haproxy/ssl_ckch.h
include/haproxy/ssl_sock.h
src/ssl_ckch.c
src/ssl_crtlist.c
src/ssl_sock.c