SSL: fixed subjectAltName and commonName debug logging.

Previously, ASN1_STRING_length() was used as a length for "%*s" format
specifier, which is wrong, since string length is expected to be "size_t",
and ASN1_STRING_length() returns "int".

Origin: <https://freenginx.org/hg/nginx/rev/a540fac7e04a>
Signed-off-by: Eugene Grebenschikov <e.grebenshchikov@f5.com>
This commit is contained in:
Maxim Dounin 2025-08-21 04:40:59 +03:00 • committed by Eugene
parent 1967e2bdc4
commit 0831b97e72

View file

@ -5369,7 +5369,8 @@ ngx_ssl_check_host(ngx_connection_t *c, ngx_str_t *name)
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"SSL subjectAltName: \"%*s\"",
ASN1_STRING_length(str), ASN1_STRING_data(str));
(size_t) ASN1_STRING_length(str),
ASN1_STRING_data(str));
if (ngx_ssl_check_name(name, str) == NGX_OK) {
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
@ -5411,7 +5412,8 @@ ngx_ssl_check_host(ngx_connection_t *c, ngx_str_t *name)
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"SSL commonName: \"%*s\"",
ASN1_STRING_length(str), ASN1_STRING_data(str));
(size_t) ASN1_STRING_length(str),
ASN1_STRING_data(str));
if (ngx_ssl_check_name(name, str) == NGX_OK) {
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,