Mercurial > hg > nginx
diff src/event/ngx_event_quic_protection.c @ 8651:dbad2d6d1898 quic
QUIC: removed ngx_quic_hexdump() macro.
Instead, appropriate format specifier for hexadecimal is used
in ngx_log_debug().
The STREAM frame "data" debug is moved into ngx_quic_log_frame(), similar
to all other frame fields debug.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Fri, 27 Nov 2020 18:43:36 +0300 |
parents | 4bf332873a83 |
children | a4c05aff8ec0 |
line wrap: on
line diff
--- a/src/event/ngx_event_quic_protection.c Wed Nov 25 17:57:43 2020 +0000 +++ b/src/event/ngx_event_quic_protection.c Fri Nov 27 18:43:36 2020 +0300 @@ -183,8 +183,10 @@ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pool->log, 0, "quic ngx_quic_set_initial_secret"); #ifdef NGX_QUIC_DEBUG_CRYPTO - ngx_quic_hexdump(pool->log, "quic salt", salt, sizeof(salt)); - ngx_quic_hexdump(pool->log, "quic initial secret", is, is_len); + ngx_log_debug3(NGX_LOG_DEBUG_EVENT, pool->log, 0, + "quic salt len:%uz %*xs", sizeof(salt), sizeof(salt), salt); + ngx_log_debug3(NGX_LOG_DEBUG_EVENT, pool->log, 0, + "quic initial secret len:%uz %*xs", is_len, is_len, is); #endif /* draft-ietf-quic-tls-23#section-5.2 */ @@ -292,8 +294,8 @@ } #ifdef NGX_QUIC_DEBUG_CRYPTO - ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pool->log, 0, "quic expand %V", label); - ngx_quic_hexdump(pool->log, "quic key", out->data, out->len); + ngx_log_debug3(NGX_LOG_DEBUG_EVENT, pool->log, 0, + "quic expand %V key len:%uz %xV", label, out->len, out); #endif return NGX_OK; @@ -840,7 +842,8 @@ out.data = res->data + ad.len; #ifdef NGX_QUIC_DEBUG_CRYPTO - ngx_quic_hexdump(pkt->log, "quic ad", ad.data, ad.len); + ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0, + "quic ad len:%uz %xV", ad.len, &ad); #endif if (ngx_quic_ciphers(pkt->keys->cipher, &ciphers, pkt->level) == NGX_ERROR) @@ -910,7 +913,8 @@ itag.len = EVP_GCM_TLS_TAG_LEN; #ifdef NGX_QUIC_DEBUG_CRYPTO - ngx_quic_hexdump(pkt->log, "quic retry itag", ad.data, ad.len); + ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0, + "quic retry itag len:%uz %xV", ad.len, &ad); #endif if (ngx_quic_ciphers(0, &ciphers, pkt->level) == NGX_ERROR) { @@ -982,8 +986,9 @@ ngx_memcpy(token, key, NGX_QUIC_SR_TOKEN_LEN); #if (NGX_DEBUG) - ngx_quic_hexdump(c->log, "quic stateless reset token", token, - (size_t) NGX_QUIC_SR_TOKEN_LEN); + ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0, + "quic stateless reset token %*xs", + (size_t) NGX_QUIC_SR_TOKEN_LEN, token); #endif return NGX_OK; @@ -1138,7 +1143,8 @@ ngx_quic_compute_nonce(nonce, sizeof(nonce), pn); #ifdef NGX_QUIC_DEBUG_CRYPTO - ngx_quic_hexdump(pkt->log, "quic ad", ad.data, ad.len); + ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0, + "quic ad len:%uz %xV", ad.len, &ad); #endif pkt->payload.len = in.len - EVP_GCM_TLS_TAG_LEN; @@ -1174,8 +1180,9 @@ } #if defined(NGX_QUIC_DEBUG_CRYPTO) && defined(NGX_QUIC_DEBUG_PACKETS) - ngx_quic_hexdump(pkt->log, "quic packet payload", - pkt->payload.data, pkt->payload.len); + ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0, + "quic packet payload len:%uz %xV", + pkt->payload.len, &pkt->payload); #endif *largest_pn = lpn;