From d6003648872112947bdd11611ea6351aa9f5727d Mon Sep 17 00:00:00 2001 From: Vladimir Homutov Date: Fri, 2 Oct 2020 12:40:49 +0300 Subject: [PATCH] QUIC: enabled more key-related debug by default. --- src/event/ngx_event_quic.c | 15 ++++++++++++--- src/event/ngx_event_quic_protection.c | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index 3aed7573c..99de10d16 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -353,9 +353,9 @@ ngx_quic_set_read_secret(ngx_ssl_conn_t *ssl_conn, c = ngx_ssl_get_connection((ngx_ssl_conn_t *) ssl_conn); -#ifdef NGX_QUIC_DEBUG_CRYPTO 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); #endif @@ -377,9 +377,9 @@ ngx_quic_set_write_secret(ngx_ssl_conn_t *ssl_conn, c = ngx_ssl_get_connection((ngx_ssl_conn_t *) ssl_conn); -#ifdef NGX_QUIC_DEBUG_CRYPTO 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); #endif @@ -403,9 +403,9 @@ ngx_quic_set_encryption_secrets(ngx_ssl_conn_t *ssl_conn, c = ngx_ssl_get_connection((ngx_ssl_conn_t *) ssl_conn); -#ifdef NGX_QUIC_DEBUG_CRYPTO 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", rsecret, secret_len); #endif @@ -1691,6 +1691,15 @@ ngx_quic_process_packet(ngx_connection_t *c, ngx_quic_conf_t *conf, qc = c->quic; +#if (NGX_DEBUG) + ngx_quic_hexdump(c->log, "quic pkt dcid", pkt->dcid.data, pkt->dcid.len); + + if (pkt->level != ssl_encryption_application) { + ngx_quic_hexdump(c->log, "quic pkt scid", pkt->scid.data, + pkt->scid.len); + } +#endif + if (qc) { if (rc == NGX_ABORT) { diff --git a/src/event/ngx_event_quic_protection.c b/src/event/ngx_event_quic_protection.c index 0bb9e8f87..450281aea 100644 --- a/src/event/ngx_event_quic_protection.c +++ b/src/event/ngx_event_quic_protection.c @@ -165,9 +165,9 @@ ngx_quic_set_initial_secret(ngx_pool_t *pool, ngx_quic_secret_t *client, .len = is_len }; -#ifdef NGX_QUIC_DEBUG_CRYPTO 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); #endif