changeset 8709:81bb3a690c10 quic

QUIC: removed support prior to draft-29.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 18 Feb 2021 19:21:09 +0300
parents 98bacfc65c61
children 44b4c6180106
files src/event/quic/ngx_event_quic.c src/event/quic/ngx_event_quic_protection.c src/event/quic/ngx_event_quic_transport.c
diffstat 3 files changed, 4 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- 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_conn
 
     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_conn
                       "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
         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) {
--- 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_poo
 #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_he
     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)
+#else
         "\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";
 #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)
+#else
         "\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";
 #endif
     static ngx_str_t  in = ngx_string("");
 
--- 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
          /* 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 *
                    "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 
     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 
     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);