changeset 8194:817c82af127f quic

Style.
author Vladimir Homutov <vl@nginx.com>
date Thu, 05 Mar 2020 17:24:04 +0300
parents 4355efde26d8
children 2d7202fc05d1
files src/event/ngx_event_quic.c
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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;