]> git.kaiwu.me - nginx.git/commitdiff
QUIC: normalize header inclusion.
authorSergey Kandaurov <pluknet@nginx.com>
Tue, 13 Apr 2021 09:38:34 +0000 (12:38 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Tue, 13 Apr 2021 09:38:34 +0000 (12:38 +0300)
Stop including QUIC headers with no user-serviceable parts inside.
This allows to provide a much cleaner QUIC interface.  To cope with that,
ngx_quic_derive_key() is now explicitly exported for v3 and quic modules.
Additionally, this completely hides the ngx_quic_keys_t internal type.

src/event/quic/ngx_event_quic.h
src/event/quic/ngx_event_quic_connection.h
src/event/quic/ngx_event_quic_protection.c
src/event/quic/ngx_event_quic_protection.h
src/event/quic/ngx_event_quic_streams.c
src/event/quic/ngx_event_quic_tokens.c
src/event/quic/ngx_event_quic_transport.c
src/http/modules/ngx_http_quic_module.c
src/stream/ngx_stream_quic_module.c

index 66395dbcfa731fe8a165a060480faa6d7d02c171..8a442b4b3f0f4485ceac61fb3f196fef832064d8 100644 (file)
@@ -85,9 +85,6 @@ struct ngx_quic_stream_s {
 };
 
 
-typedef struct ngx_quic_keys_s  ngx_quic_keys_t;
-
-
 void ngx_quic_run(ngx_connection_t *c, ngx_quic_conf_t *conf);
 ngx_connection_t *ngx_quic_open_stream(ngx_connection_t *c, ngx_uint_t bidi);
 void ngx_quic_finalize_connection(ngx_connection_t *c, ngx_uint_t err,
@@ -98,5 +95,7 @@ ngx_int_t ngx_quic_reset_stream(ngx_connection_t *c, ngx_uint_t err);
 uint32_t ngx_quic_version(ngx_connection_t *c);
 ngx_int_t ngx_quic_get_packet_dcid(ngx_log_t *log, u_char *data, size_t len,
     ngx_str_t *dcid);
+ngx_int_t ngx_quic_derive_key(ngx_log_t *log, const char *label,
+    ngx_str_t *secret, ngx_str_t *salt, u_char *out, size_t len);
 
 #endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */
index 992397a66b931bc84c0597632db02a280626df7a..03495a68400f6f8d6388a3c0300cf790932fcecd 100644 (file)
 #include <ngx_core.h>
 #include <ngx_event.h>
 
-#include <ngx_event_quic_transport.h>
-#include <ngx_event_quic_protection.h>
-
 typedef struct ngx_quic_connection_s  ngx_quic_connection_t;
 typedef struct ngx_quic_send_ctx_s    ngx_quic_send_ctx_t;
+typedef struct ngx_quic_keys_s        ngx_quic_keys_t;
 
+#include <ngx_event_quic_transport.h>
+#include <ngx_event_quic_protection.h>
 #include <ngx_event_quic_frames.h>
 #include <ngx_event_quic_migration.h>
 #include <ngx_event_quic_connid.h>
index 12dd233b81dde3e577fa1127b2c6a7f1f11cf6d0..d1801d05f65fdf6d7021da424816033ae9feaabd 100644 (file)
@@ -7,8 +7,7 @@
 #include <ngx_config.h>
 #include <ngx_core.h>
 #include <ngx_event.h>
-#include <ngx_event_quic_transport.h>
-#include <ngx_event_quic_protection.h>
+#include <ngx_event_quic_connection.h>
 
 
 #define NGX_QUIC_IV_LEN               12
index a351c9b1bbd884b87e2117a63145e58835e1c218..7a1604c6c4ac262ffa988e30bd8dfffb97801c3f 100644 (file)
@@ -29,8 +29,6 @@ void ngx_quic_keys_discard(ngx_quic_keys_t *keys,
     enum ssl_encryption_level_t level);
 void ngx_quic_keys_switch(ngx_connection_t *c, ngx_quic_keys_t *keys);
 ngx_int_t ngx_quic_keys_update(ngx_connection_t *c, ngx_quic_keys_t *keys);
-ngx_int_t ngx_quic_derive_key(ngx_log_t *log, const char *label,
-    ngx_str_t *secret, ngx_str_t *salt, u_char *out, size_t len);
 ngx_int_t ngx_quic_encrypt(ngx_quic_header_t *pkt, ngx_str_t *res);
 ngx_int_t ngx_quic_decrypt(ngx_quic_header_t *pkt, uint64_t *largest_pn);
 
index 1174ea11e7dd77f0eef614bd611b2c4b87e08ab9..716550b3d986a8ea3278744e8ae853b915a337af 100644 (file)
@@ -7,9 +7,7 @@
 #include <ngx_config.h>
 #include <ngx_core.h>
 #include <ngx_event.h>
-#include <ngx_event_quic_transport.h>
 #include <ngx_event_quic_connection.h>
-#include <ngx_event_quic_streams.h>
 
 
 #define NGX_QUIC_STREAM_GONE     (void *) -1
index cbfc356d720efa8d6ebb693af744bafb7c1b7a23..b896611e3393c5bf4add3d6e0ba00759ce9d159c 100644 (file)
@@ -8,7 +8,7 @@
 #include <ngx_core.h>
 #include <ngx_event.h>
 #include <ngx_sha1.h>
-#include <ngx_event_quic_protection.h>
+#include <ngx_event_quic_connection.h>
 
 
 #define NGX_QUIC_MAX_TOKEN_SIZE              64
index 27dbf92af6c382302182cf7a3718095a7a022e5c..2c952177cc4b9c35a53f65550fe821842bb54cf9 100644 (file)
@@ -7,7 +7,7 @@
 #include <ngx_config.h>
 #include <ngx_core.h>
 #include <ngx_event.h>
-#include <ngx_event_quic_transport.h>
+#include <ngx_event_quic_connection.h>
 
 
 #define NGX_QUIC_LONG_DCID_LEN_OFFSET  5
index 5282bf4bbacc6fcaa25c5068a659efc218680a7c..b7661b42ce07965c184f1496a8f89eaebd0e8fac 100644 (file)
@@ -9,8 +9,6 @@
 #include <ngx_core.h>
 #include <ngx_http.h>
 
-#include <ngx_event_quic_protection.h>
-
 
 static ngx_int_t ngx_http_variable_quic(ngx_http_request_t *r,
     ngx_http_variable_value_t *v, uintptr_t data);
index 6a67680b2f1484d004ded57386ecdf43dced9d96..6567b16cf3260572c1fcfed84de67ddd127eacce 100644 (file)
@@ -9,8 +9,6 @@
 #include <ngx_core.h>
 #include <ngx_stream.h>
 
-#include <ngx_event_quic_protection.h>
-
 
 static ngx_int_t ngx_stream_variable_quic(ngx_stream_session_t *s,
     ngx_stream_variable_value_t *v, uintptr_t data);