]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: ssl: append OCSP base64 newline to the output buffer master
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 24 Nov 2026 17:15:34 +0000 (17:15 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 24 Nov 2026 17:15:55 +0000 (17:15 +0000)
commite796a922661b0ddc8c7d8849b8a6728811cc8170
treec1f28147948be80e3e51cd3e30adb75701c845e9
parent86c12f743f30deb3ec39560def6aa6326acb6039
BUG/MINOR: ssl: append OCSP base64 newline to the output buffer

ssl_ocsp_response_print_base64() encodes the response into the output
buffer, but attempts to append the trailing newline to the stored OCSP
response instead. As a result, the base64 dump lacks its terminating
newline.

Stored responses are allocated by chunk_dup() with at most one spare
byte. Since chunk_appendf() also needs room for a terminating NUL, this
does not extend the stored response, contrary to the reported impact.

Append the newline to the output buffer instead. The separate missing
OCSP lock in the CLI detail handler is not addressed by this patch.

Verified with 100 repeated CLI dumps and TLS stapling before and after
the reads. Each dump decodes to the original OCSP response.

Reported by brhenc in GitHub issue #3593:
https://github.com/haproxy/haproxy/issues/3593

The bug was introduced in 9c4437d02 ("MINOR: ssl: Add way to dump ocsp
response in base64"), first released in 2.8.

This fix should be backported to all maintained branches since 2.8.
src/ssl_ocsp.c