Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic_protection.c @ 9040:8c0bccdf2743 quic
QUIC: avoid using C99 designated initializers.
They are not supported by MSVC till 2012.
SSL_QUIC_METHOD initialization is moved to run-time to preserve portability
among SSL library implementations, which allows to reduce its visibility.
Note using of a static storage to keep SSL_set_quic_method() reference valid.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 22 Nov 2022 18:05:35 +0400 |
parents | a6cc246654f8 |
children | e23fd55e1cc6 |
comparison
equal
deleted
inserted
replaced
9039:a6cc246654f8 | 9040:8c0bccdf2743 |
---|---|
145 ngx_quic_keys_set_initial_secret(ngx_quic_keys_t *keys, ngx_str_t *secret, | 145 ngx_quic_keys_set_initial_secret(ngx_quic_keys_t *keys, ngx_str_t *secret, |
146 ngx_log_t *log) | 146 ngx_log_t *log) |
147 { | 147 { |
148 size_t is_len; | 148 size_t is_len; |
149 uint8_t is[SHA256_DIGEST_LENGTH]; | 149 uint8_t is[SHA256_DIGEST_LENGTH]; |
150 ngx_str_t iss; | |
150 ngx_uint_t i; | 151 ngx_uint_t i; |
151 const EVP_MD *digest; | 152 const EVP_MD *digest; |
152 ngx_quic_hkdf_t seq[8]; | 153 ngx_quic_hkdf_t seq[8]; |
153 ngx_quic_secret_t *client, *server; | 154 ngx_quic_secret_t *client, *server; |
154 | 155 |
174 != NGX_OK) | 175 != NGX_OK) |
175 { | 176 { |
176 return NGX_ERROR; | 177 return NGX_ERROR; |
177 } | 178 } |
178 | 179 |
179 ngx_str_t iss = { | 180 iss.len = is_len; |
180 .data = is, | 181 iss.data = is; |
181 .len = is_len | |
182 }; | |
183 | 182 |
184 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, log, 0, | 183 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, log, 0, |
185 "quic ngx_quic_set_initial_secret"); | 184 "quic ngx_quic_set_initial_secret"); |
186 #ifdef NGX_QUIC_DEBUG_CRYPTO | 185 #ifdef NGX_QUIC_DEBUG_CRYPTO |
187 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0, | 186 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0, |