]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: acme: key not restored upon error in acme_res_certificate() V2
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 16 Apr 2025 12:05:04 +0000 (14:05 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 16 Apr 2025 12:05:04 +0000 (14:05 +0200)
commit7814a8b446c38cf1c2155a224c340d895faf84fa
tree4eba525f50425a54340f1ad1c7ebd3c9ba09572c
parente21a165af68f4c9a91b5d1ba37a26780257a880c
BUG/MINOR: acme: key not restored upon error in acme_res_certificate() V2

When receiving the final certificate, it need to be loaded by
ssl_sock_load_pem_into_ckch(). However this function will remove any
existing private key in the struct ckch_store.

In order to fix the issue, the ptr to the key is swapped with a NULL
ptr, and restored once the new certificate is commited.

However there is a discrepancy when there is an error in
ssl_sock_load_pem_into_ckch() fails and the pointer is lost.

This patch fixes the issue by restoring the pointer in the error path.

This must fix issue #2933.
src/acme.c