From: William Lallemand Date: Tue, 24 Nov 2026 17:15:34 +0000 (+0000) Subject: BUG/MINOR: ssl: append OCSP base64 newline to the output buffer X-Git-Url: https://git.kaiwu.me/http/%7B@url%7D?a=commitdiff_plain;h=e796a922661b0ddc8c7d8849b8a6728811cc8170;p=haproxy.git 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. --- diff --git a/src/ssl_ocsp.c b/src/ssl_ocsp.c index cd14ffef6..f539d8bb9 100644 --- a/src/ssl_ocsp.c +++ b/src/ssl_ocsp.c @@ -707,7 +707,7 @@ static int ssl_ocsp_response_print_base64(struct buffer *ocsp_response, struct b out->data = b64len; /* Add empty line */ - chunk_appendf(ocsp_response, "\n"); + chunk_appendf(out, "\n"); return 0; }