From cd276b5ed6f19d39d0e5e3ca615a31931c1f7ddf Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Thu, 18 Feb 2021 19:21:09 +0300 Subject: [PATCH] QUIC: removed support prior to draft-29. --- src/event/quic/ngx_event_quic.c | 4 ---- src/event/quic/ngx_event_quic_protection.c | 13 +++--------- src/event/quic/ngx_event_quic_transport.c | 23 +--------------------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c index 0484909cf..e6ad61083 100644 --- a/src/event/quic/ngx_event_quic.c +++ b/src/event/quic/ngx_event_quic.c @@ -988,7 +988,6 @@ ngx_quic_apply_transport_params(ngx_connection_t *c, ngx_quic_tp_t *ctp) qc = ngx_quic_get_connection(c); -#if (NGX_QUIC_DRAFT_VERSION >= 28) if (qc->scid.len != ctp->initial_scid.len || ngx_memcmp(qc->scid.data, ctp->initial_scid.data, qc->scid.len) != 0) { @@ -996,7 +995,6 @@ ngx_quic_apply_transport_params(ngx_connection_t *c, ngx_quic_tp_t *ctp) "quic client initial_source_connection_id mismatch"); return NGX_ERROR; } -#endif if (ctp->max_udp_payload_size < NGX_QUIC_MIN_INITIAL_SIZE || ctp->max_udp_payload_size > NGX_QUIC_MAX_UDP_PAYLOAD_SIZE) @@ -1204,9 +1202,7 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_quic_conf_t *conf, return NULL; } -#if (NGX_QUIC_DRAFT_VERSION >= 28) qc->tp.original_dcid = qc->odcid; -#endif qc->tp.initial_scid = qc->dcid; if (pkt->validated && pkt->retried) { diff --git a/src/event/quic/ngx_event_quic_protection.c b/src/event/quic/ngx_event_quic_protection.c index 4617fe83c..b6e6e8861 100644 --- a/src/event/quic/ngx_event_quic_protection.c +++ b/src/event/quic/ngx_event_quic_protection.c @@ -155,12 +155,9 @@ ngx_quic_keys_set_initial_secret(ngx_pool_t *pool, ngx_quic_keys_t *keys, #if (NGX_QUIC_DRAFT_VERSION >= 33) "\x38\x76\x2c\xf7\xf5\x59\x34\xb3\x4d\x17" "\x9a\xe6\xa4\xc8\x0c\xad\xcc\xbb\x7f\x0a"; -#elif (NGX_QUIC_DRAFT_VERSION >= 29) +#else "\xaf\xbf\xec\x28\x99\x93\xd2\x4c\x9e\x97" "\x86\xf1\x9c\x61\x11\xe0\x43\x90\xa8\x99"; -#else - "\xc3\xee\xf7\x12\xc7\x2e\xbb\x5a\x11\xa7" - "\xd2\x43\x2b\xb4\x63\x65\xbe\xf9\xf5\x02"; #endif client = &keys->secrets[ssl_encryption_initial].client; @@ -894,18 +891,14 @@ ngx_quic_create_retry_packet(ngx_quic_header_t *pkt, ngx_str_t *res) static u_char key[16] = #if (NGX_QUIC_DRAFT_VERSION >= 33) "\xbe\x0c\x69\x0b\x9f\x66\x57\x5a\x1d\x76\x6b\x54\xe3\x68\xc8\x4e"; -#elif (NGX_QUIC_DRAFT_VERSION >= 29) - "\xcc\xce\x18\x7e\xd0\x9a\x09\xd0\x57\x28\x15\x5a\x6c\xb9\x6b\xe1"; #else - "\x4d\x32\xec\xdb\x2a\x21\x33\xc8\x41\xe4\x04\x3d\xf2\x7d\x44\x30"; + "\xcc\xce\x18\x7e\xd0\x9a\x09\xd0\x57\x28\x15\x5a\x6c\xb9\x6b\xe1"; #endif static u_char nonce[12] = #if (NGX_QUIC_DRAFT_VERSION >= 33) "\x46\x15\x99\xd3\x5d\x63\x2b\xf2\x23\x98\x25\xbb"; -#elif (NGX_QUIC_DRAFT_VERSION >= 29) - "\xe5\x49\x30\xf9\x7f\x21\x36\xf0\x53\x0a\x8c\x1c"; #else - "\x4d\x16\x11\xd0\x55\x13\xa5\x52\xc5\x87\xd5\x75"; + "\xe5\x49\x30\xf9\x7f\x21\x36\xf0\x53\x0a\x8c\x1c"; #endif static ngx_str_t in = ngx_string(""); diff --git a/src/event/quic/ngx_event_quic_transport.c b/src/event/quic/ngx_event_quic_transport.c index 0c6d73eb3..2d540fe9f 100644 --- a/src/event/quic/ngx_event_quic_transport.c +++ b/src/event/quic/ngx_event_quic_transport.c @@ -130,13 +130,11 @@ uint32_t ngx_quic_versions[] = { /* QUICv1 */ 0x00000001, NGX_QUIC_VERSION(33), -#elif (NGX_QUIC_DRAFT_VERSION >= 29) +#else NGX_QUIC_VERSION(29), NGX_QUIC_VERSION(30), NGX_QUIC_VERSION(31), NGX_QUIC_VERSION(32), -#else - NGX_QUIC_VERSION(NGX_QUIC_DRAFT_VERSION) #endif }; @@ -1125,13 +1123,8 @@ ngx_quic_frame_allowed(ngx_quic_header_t *pkt, ngx_uint_t frame_type) /* RETIRE_CONNECTION_ID */ 0x3, /* PATH_CHALLENGE */ 0x3, /* PATH_RESPONSE */ 0x3, -#if (NGX_QUIC_DRAFT_VERSION >= 28) /* CONNECTION_CLOSE */ 0xF, /* CONNECTION_CLOSE2 */ 0x3, -#else - /* CONNECTION_CLOSE */ 0xD, - /* CONNECTION_CLOSE2 */ 0x1, -#endif /* HANDSHAKE_DONE */ 0x0, /* only sent by server */ }; @@ -1745,11 +1738,9 @@ ngx_quic_parse_transport_params(u_char *p, u_char *end, ngx_quic_tp_t *tp, "quic tp active_connection_id_limit:%ui", tp->active_connection_id_limit); -#if (NGX_QUIC_DRAFT_VERSION >= 28) ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0, "quic tp initial source_connection_id len:%uz %xV", tp->initial_scid.len, &tp->initial_scid); -#endif return NGX_OK; } @@ -1946,18 +1937,12 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp, len += ngx_quic_tp_len(NGX_QUIC_TP_ACK_DELAY_EXPONENT, tp->ack_delay_exponent); -#if (NGX_QUIC_DRAFT_VERSION >= 28) len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); len += ngx_quic_tp_strlen(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); if (tp->retry_scid.len) { len += ngx_quic_tp_strlen(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid); } -#else - if (tp->original_dcid.len) { - len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); - } -#endif len += ngx_quic_varint_len(NGX_QUIC_TP_SR_TOKEN); len += ngx_quic_varint_len(NGX_QUIC_SR_TOKEN_LEN); @@ -2005,18 +1990,12 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp, ngx_quic_tp_vint(NGX_QUIC_TP_ACK_DELAY_EXPONENT, tp->ack_delay_exponent); -#if (NGX_QUIC_DRAFT_VERSION >= 28) ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); ngx_quic_tp_str(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); if (tp->retry_scid.len) { ngx_quic_tp_str(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid); } -#else - if (tp->original_dcid.len) { - ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); - } -#endif ngx_quic_build_int(&p, NGX_QUIC_TP_SR_TOKEN); ngx_quic_build_int(&p, NGX_QUIC_SR_TOKEN_LEN);