# HG changeset patch # User Vladimir Homutov # Date 1583418244 -10800 # Node ID 817c82af127f13521fab442016e08442729ca2a3 # Parent 4355efde26d87f3769b461922f3f09ff572cd61a Style. diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -994,13 +994,13 @@ ngx_quic_process_handshake_header(ngx_co static ngx_int_t ngx_quic_initial_secret(ngx_connection_t *c) { - ngx_quic_connection_t *qc = c->quic; + size_t is_len; + uint8_t is[SHA256_DIGEST_LENGTH]; + ngx_uint_t i; + const EVP_MD *digest; + const EVP_CIPHER *cipher; + ngx_quic_connection_t *qc; - size_t is_len; - uint8_t is[SHA256_DIGEST_LENGTH]; - ngx_uint_t i; - const EVP_MD *digest; - const EVP_CIPHER *cipher; static const uint8_t salt[20] = "\xc3\xee\xf7\x12\xc7\x2e\xbb\x5a\x11\xa7" "\xd2\x43\x2b\xb4\x63\x65\xbe\xf9\xf5\x02"; @@ -1010,6 +1010,8 @@ ngx_quic_initial_secret(ngx_connection_t cipher = EVP_aes_128_gcm(); digest = EVP_sha256(); + qc = c->quic; + if (ngx_hkdf_extract(is, &is_len, digest, qc->dcid.data, qc->dcid.len, salt, sizeof(salt)) != NGX_OK) @@ -1264,7 +1266,7 @@ ngx_quic_new_connection(ngx_connection_t out = pkt.payload; - if (out.data[0] != 0x06) { + if (out.data[0] != NGX_QUIC_FT_CRYPTO) { ngx_log_error(NGX_LOG_INFO, c->log, 0, "unexpected frame in initial packet"); return NGX_ERROR; @@ -1407,7 +1409,7 @@ ngx_quic_handshake_input(ngx_connection_ out = pkt.payload; - if (out.data[0] != 0x06) { + if (out.data[0] != NGX_QUIC_FT_CRYPTO) { ngx_log_error(NGX_LOG_INFO, c->log, 0, "non-CRYPTO frame in HS packet, skipping"); return NGX_OK;