summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2020-04-23 11:50:20 +0300
committerVladimir Homutov <vl@nginx.com>2020-04-23 11:50:20 +0300
commite34161c3d52f84ec9a07bcf7bb94e1ac5a81ce63 (patch)
tree2a2e6b0eca6c6578ac3850b8f0220b5fdc5f2e4d
parent26b7056972b52c210d43ff52d018b952cce109a5 (diff)
downloadnginx-e34161c3d52f84ec9a07bcf7bb94e1ac5a81ce63.tar.gz
nginx-e34161c3d52f84ec9a07bcf7bb94e1ac5a81ce63.tar.bz2
Removed support of drafts older than currently latest 27.
-rw-r--r--src/event/ngx_event_quic.c6
-rw-r--r--src/event/ngx_event_quic_transport.c92
2 files changed, 1 insertions, 97 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c
index 603e88d8d..2e31ac9c4 100644
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -1903,10 +1903,6 @@ ngx_quic_crypto_input(ngx_connection_t *c, ngx_quic_frame_t *frame)
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
"handshake completed successfully");
-#if (NGX_QUIC_DRAFT_VERSION >= 27)
- {
- ngx_quic_frame_t *frame;
-
frame = ngx_quic_alloc_frame(c, 0);
if (frame == NULL) {
return NGX_ERROR;
@@ -1917,8 +1913,6 @@ ngx_quic_crypto_input(ngx_connection_t *c, ngx_quic_frame_t *frame)
frame->type = NGX_QUIC_FT_HANDSHAKE_DONE;
ngx_sprintf(frame->info, "HANDSHAKE DONE on handshake completed");
ngx_quic_queue_frame(c->quic, frame);
- }
-#endif
/*
* Generating next keys before a key update is received.
diff --git a/src/event/ngx_event_quic_transport.c b/src/event/ngx_event_quic_transport.c
index 19e7ba305..fdaf8b88e 100644
--- a/src/event/ngx_event_quic_transport.c
+++ b/src/event/ngx_event_quic_transport.c
@@ -61,7 +61,6 @@ static u_char *ngx_quic_parse_int_multi(u_char *pos, u_char *end, ...);
static void ngx_quic_build_int(u_char **pos, uint64_t value);
static u_char *ngx_quic_read_uint8(u_char *pos, u_char *end, uint8_t *value);
-/*static*/ u_char *ngx_quic_read_uint16(u_char *pos, u_char *end, uint16_t *value); // usage depends on NGX_QUIC_VERSION
static u_char *ngx_quic_read_uint32(u_char *pos, u_char *end, uint32_t *value);
static u_char *ngx_quic_read_bytes(u_char *pos, u_char *end, size_t len,
u_char **out);
@@ -182,19 +181,6 @@ ngx_quic_read_uint8(u_char *pos, u_char *end, uint8_t *value)
}
-/*static*/ ngx_inline u_char *
-ngx_quic_read_uint16(u_char *pos, u_char *end, uint16_t *value)
-{
- if ((size_t)(end - pos) < sizeof(uint16_t)) {
- return NULL;
- }
-
- *value = ngx_quic_parse_uint16(pos);
-
- return pos + sizeof(uint16_t);
-}
-
-
static ngx_inline u_char *
ngx_quic_read_uint32(u_char *pos, u_char *end, uint32_t *value)
{
@@ -1452,55 +1438,9 @@ ngx_int_t
ngx_quic_parse_transport_params(u_char *p, u_char *end, ngx_quic_tp_t *tp,
ngx_log_t *log)
{
+ uint64_t id, len;
ngx_int_t rc;
-#if (NGX_QUIC_DRAFT_VERSION < 27)
-
- uint16_t id, len, tp_len;
-
- p = ngx_quic_read_uint16(p, end, &tp_len);
- if (p == NULL) {
- ngx_log_error(NGX_LOG_INFO, log, 0,
- "failed to parse total transport params length");
- return NGX_ERROR;
- }
-
- while (p < end) {
-
- p = ngx_quic_read_uint16(p, end, &id);
- if (p == NULL) {
- ngx_log_error(NGX_LOG_INFO, log, 0,
- "failed to parse transport param id");
- return NGX_ERROR;
- }
-
- p = ngx_quic_read_uint16(p, end, &len);
- if (p == NULL) {
- ngx_log_error(NGX_LOG_INFO, log, 0,
- "failed to parse transport param id 0x%xi length", id);
- return NGX_ERROR;
- }
-
- rc = ngx_quic_parse_transport_param(p, p + len, id, tp);
-
- if (rc == NGX_ERROR) {
- ngx_log_error(NGX_LOG_INFO, log, 0,
- "failed to parse transport param id 0x%xi data", id);
- return NGX_ERROR;
- }
-
- if (rc == NGX_DECLINED) {
- ngx_log_error(NGX_LOG_INFO, log, 0,
- "unknown transport param id 0x%xi, skipped", id);
- }
-
- p += len;
- };
-
-#else
-
- uint64_t id, len;
-
while (p < end) {
p = ngx_quic_parse_int(p, end, &id);
if (p == NULL) {
@@ -1530,11 +1470,8 @@ ngx_quic_parse_transport_params(u_char *p, u_char *end, ngx_quic_tp_t *tp,
}
p += len;
-
}
-#endif
-
if (p != end) {
ngx_log_error(NGX_LOG_INFO, log, 0,
"trailing garbage in transport parameters: %ui bytes",
@@ -1542,7 +1479,6 @@ ngx_quic_parse_transport_params(u_char *p, u_char *end, ngx_quic_tp_t *tp,
return NGX_ERROR;
}
-
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, log, 0,
"client transport parameters parsed successfully");
@@ -1641,22 +1577,6 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp)
u_char *p;
size_t len;
-#if (NGX_QUIC_DRAFT_VERSION < 27)
-
-/* older drafts with static transport parameters encoding */
-
-#define ngx_quic_tp_len(id, value) \
- 4 + ngx_quic_varint_len(value)
-
-#define ngx_quic_tp_vint(id, value) \
- do { \
- p = ngx_quic_write_uint16(p, id); \
- p = ngx_quic_write_uint16(p, ngx_quic_varint_len(value)); \
- ngx_quic_build_int(&p, value); \
- } while (0)
-
-#else
-
/* recent drafts with variable integer transport parameters encoding */
#define ngx_quic_tp_len(id, value) \
@@ -1671,8 +1591,6 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp)
ngx_quic_build_int(&p, value); \
} while (0)
-#endif
-
p = pos;
len = ngx_quic_tp_len(NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT,
@@ -1699,17 +1617,9 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp)
tp->max_idle_timeout);
if (pos == NULL) {
-#if (NGX_QUIC_DRAFT_VERSION < 27)
- len += 2;
-#endif
return len;
}
-#if (NGX_QUIC_DRAFT_VERSION < 27)
- /* TLS extension length */
- p = ngx_quic_write_uint16(p, len);
-#endif
-
ngx_quic_tp_vint(NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT,
tp->active_connection_id_limit);