p = ngx_slprintf(p, last, " fin:1");
}
+#ifdef NGX_QUIC_DEBUG_FRAMES
+ p = ngx_slprintf(p, last, " data len:%uL %*xs", f->u.stream.length,
+ (size_t) f->u.stream.length, f->u.stream.data);
+#endif
+
break;
case NGX_QUIC_FT_MAX_DATA:
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic ngx_quic_set_read_secret() level:%d", level);
#ifdef NGX_QUIC_DEBUG_CRYPTO
- ngx_quic_hexdump(c->log, "quic read secret", rsecret, secret_len);
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic read secret len:%uz %*xs", secret_len,
+ secret_len, rsecret);
#endif
return ngx_quic_keys_set_encryption_secret(c->pool, 0, qc->keys, level,
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic ngx_quic_set_write_secret() level:%d", level);
#ifdef NGX_QUIC_DEBUG_CRYPTO
- ngx_quic_hexdump(c->log, "quic write secret", wsecret, secret_len);
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic write secret len:%uz %*xs", secret_len,
+ secret_len, wsecret);
#endif
return ngx_quic_keys_set_encryption_secret(c->pool, 1, qc->keys, level,
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic ngx_quic_set_encryption_secrets() level:%d", level);
#ifdef NGX_QUIC_DEBUG_CRYPTO
- ngx_quic_hexdump(c->log, "quic read secret", rsecret, secret_len);
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic read secret len:%uz %*xs", secret_len,
+ secret_len, rsecret);
#endif
cipher = SSL_get_current_cipher(ssl_conn);
}
#ifdef NGX_QUIC_DEBUG_CRYPTO
- ngx_quic_hexdump(c->log, "quic write secret", wsecret, secret_len);
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic write secret len:%uz %*xs", secret_len,
+ secret_len, wsecret);
#endif
return ngx_quic_keys_set_encryption_secret(c->pool, 1, qc->keys, level,
len = ngx_quic_create_version_negotiation(&pkt, buf);
#ifdef NGX_QUIC_DEBUG_PACKETS
- ngx_quic_hexdump(c->log, "quic vnego packet to send", buf, len);
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic vnego packet to send len:%uz %*xs", len, len, buf);
#endif
(void) c->send(c, buf, len);
return NGX_ERROR;
}
- ngx_quic_hexdump(c->log, "quic create server id",
- id, NGX_QUIC_SERVER_CID_LEN);
-
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic create server id %*xs",
+ (size_t) NGX_QUIC_SERVER_CID_LEN, id);
return NGX_OK;
}
}
#ifdef NGX_QUIC_DEBUG_PACKETS
- ngx_quic_hexdump(c->log, "quic packet to send", res.data, res.len);
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic packet to send len:%uz %xV", res.len, &res);
#endif
len = c->send(c, res.data, res.len);
EVP_CIPHER_CTX_free(ctx);
#ifdef NGX_QUIC_DEBUG_PACKETS
- ngx_quic_hexdump(c->log, "quic new token", token->data, token->len);
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic new token len:%uz %xV", token->len, token);
#endif
return NGX_OK;
return NGX_ERROR;
}
- ngx_quic_hexdump(c->log, "quic stateless reset token",
- qc->tp.sr_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, qc->tp.sr_token);
len = ngx_quic_create_transport_params(NULL, NULL, &qc->tp, &clen);
/* always succeeds */
}
#ifdef NGX_QUIC_DEBUG_PACKETS
- ngx_quic_hexdump(c->log, "quic transport parameters", p, len);
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic transport parameters len:%uz %*xs", len, len, p);
#endif
if (SSL_set_quic_transport_params(ssl_conn, p, len) == 0) {
qc = ngx_quic_get_connection(c);
-#if (NGX_DEBUG)
- ngx_quic_hexdump(c->log, "quic packet rx dcid",
- pkt->dcid.data, pkt->dcid.len);
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic packet rx dcid len:%uz %xV",
+ pkt->dcid.len, &pkt->dcid);
+#if (NGX_DEBUG)
if (pkt->level != ssl_encryption_application) {
- ngx_quic_hexdump(c->log, "quic packet rx scid", pkt->scid.data,
- pkt->scid.len);
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic packet rx scid len:%uz %xV",
+ pkt->scid.len, &pkt->scid);
}
if (pkt->level == ssl_encryption_initial) {
- ngx_quic_hexdump(c->log, "quic token", pkt->token.data, pkt->token.len);
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic token len:%uz %xV",
+ pkt->token.len, &pkt->token);
}
#endif
ngx_insert_udp_connection(c, &sid->udp, &dcid);
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "quic insert server id seqnum:%uL", sid->seqnum);
-
- ngx_quic_hexdump(c->log, "quic server id", id->data, id->len);
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ "quic insert server id seqnum:%uL id len:%uz %xV",
+ sid->seqnum, id->len, id);
return sid;
}
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 */
}
#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;
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)
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) {
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;
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;
}
#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;