]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: acme: key not restored upon error in acme_res_certificate()
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 14 Apr 2025 08:44:24 +0000 (10:44 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 14 Apr 2025 08:55:44 +0000 (10:55 +0200)
commit7a43094f8d8fe3c435ecc003f07453dd9de8134a
treed7974f501ca26c5064011545c83ce89908ef68d6
parent4a44d592ae102162f5d989630860001357de750a
BUG/MINOR: acme: key not restored upon error in acme_res_certificate()

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