]> git.kaiwu.me - nginx.git/commitdiff
QUIC: stripped down debug traces that have served its purpose.
authorSergey Kandaurov <pluknet@nginx.com>
Fri, 21 Aug 2020 11:41:41 +0000 (14:41 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Fri, 21 Aug 2020 11:41:41 +0000 (14:41 +0300)
The most observable remainers are incoming packet and stream payload
that could still be useful to debug various QUIC and HTTP/3 frames.

src/event/ngx_event_quic.c
src/event/ngx_event_quic_protection.c
src/event/ngx_event_quic_transport.c

index b410cb0e069483b21b76f5dadf58cc3cea2c0a88..7923c55293996e510df387bcc2ba7a74e847a166 100644 (file)
@@ -3651,10 +3651,6 @@ ngx_quic_send_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
         return NGX_ERROR;
     }
 
-#ifdef NGX_QUIC_DEBUG_PACKETS
-    ngx_quic_hexdump(c->log, "quic packet to send", res.data, res.len);
-#endif
-
     len = c->send(c, res.data, res.len);
     if (len == NGX_ERROR || (size_t) len != res.len) {
         return NGX_ERROR;
index 721944b9738d3f241299c3854e54c05493f23b7d..ae6ae27e7a54c13993faf7ee851852fc811d11ed 100644 (file)
@@ -277,9 +277,7 @@ ngx_quic_hkdf_expand(ngx_pool_t *pool, const EVP_MD *digest, ngx_str_t *out,
     }
 
 #ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pool->log, 0,
-                   "quic ngx_quic_hkdf_expand %V keys", label);
-    ngx_quic_hexdump(pool->log, "quic info", info, info_len);
+    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);
 #endif
 
@@ -779,8 +777,6 @@ ngx_quic_create_long_packet(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
     out.data = res->data + ad.len;
 
 #ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic ngx_quic_create_long_packet");
     ngx_quic_hexdump(pkt->log, "quic ad", ad.data, ad.len);
 #endif
 
@@ -791,11 +787,6 @@ ngx_quic_create_long_packet(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
     ngx_memcpy(nonce, pkt->secret->iv.data, pkt->secret->iv.len);
     ngx_quic_compute_nonce(nonce, sizeof(nonce), pkt->number);
 
-#ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_quic_hexdump(pkt->log, "quic server_iv", pkt->secret->iv.data, 12);
-    ngx_quic_hexdump(pkt->log, "quic nonce", nonce, 12);
-#endif
-
     if (ngx_quic_tls_seal(ciphers.c, pkt->secret, &out,
                           nonce, &pkt->payload, &ad, pkt->log)
         != NGX_OK)
@@ -810,11 +801,6 @@ ngx_quic_create_long_packet(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
         return NGX_ERROR;
     }
 
-#ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_quic_hexdump(pkt->log, "quic sample", sample, 16);
-    ngx_quic_hexdump(pkt->log, "quic mask", mask, 5);
-#endif
-
     /* quic-tls: 5.4.1.  Header Protection Application */
     ad.data[0] ^= mask[0] & 0x0f;
 
@@ -846,8 +832,6 @@ ngx_quic_create_short_packet(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
     out.data = res->data + ad.len;
 
 #ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic ngx_quic_create_short_packet");
     ngx_quic_hexdump(pkt->log, "quic ad", ad.data, ad.len);
 #endif
 
@@ -855,19 +839,9 @@ ngx_quic_create_short_packet(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
         return NGX_ERROR;
     }
 
-    ngx_log_debug3(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic ngx_quic_create_short_packet: number %L,"
-                   " encoded %d:0x%xD", pkt->number, (int) pkt->num_len,
-                   pkt->trunc);
-
     ngx_memcpy(nonce, pkt->secret->iv.data, pkt->secret->iv.len);
     ngx_quic_compute_nonce(nonce, sizeof(nonce), pkt->number);
 
-#ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_quic_hexdump(pkt->log, "quic server_iv", pkt->secret->iv.data, 12);
-    ngx_quic_hexdump(pkt->log, "quic nonce", nonce, 12);
-#endif
-
     if (ngx_quic_tls_seal(ciphers.c, pkt->secret, &out,
                           nonce, &pkt->payload, &ad, pkt->log)
         != NGX_OK)
@@ -882,11 +856,6 @@ ngx_quic_create_short_packet(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
         return NGX_ERROR;
     }
 
-#ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_quic_hexdump(pkt->log, "quic sample", sample, 16);
-    ngx_quic_hexdump(pkt->log, "quic mask", mask, 5);
-#endif
-
     /* quic-tls: 5.4.1.  Header Protection Application */
     ad.data[0] ^= mask[0] & 0x1f;
 
@@ -1052,12 +1021,6 @@ ngx_quic_decrypt(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
 
     sample = p + 4;
 
-#ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                   "quic ngx_quic_decrypt()");
-    ngx_quic_hexdump(pkt->log, "quic sample", sample, 16);
-#endif
-
     /* header protection */
 
     if (ngx_quic_tls_hp(pkt->log, ciphers.hp, secret, mask, sample)
@@ -1086,10 +1049,6 @@ ngx_quic_decrypt(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
     pkt->pn = pn;
     pkt->flags = clearflags;
 
-#ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_quic_hexdump(pkt->log, "quic mask", mask, 5);
-#endif
-
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
                    "quic clear flags: %xd", clearflags);
     ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
@@ -1122,7 +1081,6 @@ ngx_quic_decrypt(ngx_quic_header_t *pkt, ngx_ssl_conn_t *ssl_conn,
     ngx_quic_compute_nonce(nonce, sizeof(nonce), pn);
 
 #ifdef NGX_QUIC_DEBUG_CRYPTO
-    ngx_quic_hexdump(pkt->log, "quic nonce", nonce, 12);
     ngx_quic_hexdump(pkt->log, "quic ad", ad.data, ad.len);
 #endif
 
index 610f7c6eacb760401fecd757461d5e3b9f3ecce3..2fe73733dc3519ba399d3b471ddf7a6c1d5dd37e 100644 (file)
@@ -247,10 +247,6 @@ ngx_quic_parse_long_header(ngx_quic_header_t *pkt)
     p = pkt->data;
     end = pkt->data + pkt->len;
 
-#ifdef NGX_QUIC_DEBUG_PACKETS
-    ngx_quic_hexdump(pkt->log, "quic long packet in", pkt->data, pkt->len);
-#endif
-
     p = ngx_quic_read_uint8(p, end, &pkt->flags);
     if (p == NULL) {
         ngx_log_error(NGX_LOG_INFO, pkt->log, 0,
@@ -474,10 +470,6 @@ ngx_quic_parse_short_header(ngx_quic_header_t *pkt, ngx_str_t *dcid)
     p = pkt->data;
     end = pkt->data + pkt->len;
 
-#ifdef NGX_QUIC_DEBUG_PACKETS
-    ngx_quic_hexdump(pkt->log, "quic short packet in", pkt->data, pkt->len);
-#endif
-
     p = ngx_quic_read_uint8(p, end, &pkt->flags);
     if (p == NULL) {
         ngx_log_error(NGX_LOG_INFO, pkt->log, 0,
@@ -655,15 +647,10 @@ ngx_quic_parse_frame(ngx_quic_header_t *pkt, u_char *start, u_char *end,
             goto error;
         }
 
-        ngx_log_debug3(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
-                       "quic frame in: CRYPTO length: %uL off:%uL pp:%p",
-                       f->u.crypto.length, f->u.crypto.offset,
-                       f->u.crypto.data);
+        ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pkt->log, 0,
+                       "quic frame in: CRYPTO length: %uL off:%uL",
+                       f->u.crypto.length, f->u.crypto.offset);
 
-#ifdef NGX_QUIC_DEBUG_FRAMES
-        ngx_quic_hexdump(pkt->log, "quic CRYPTO frame",
-                         f->u.crypto.data, f->u.crypto.length);
-#endif
         break;
 
     case NGX_QUIC_FT_PADDING: