diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2021-04-13 12:38:34 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2021-04-13 12:38:34 +0300 |
commit | 2f5bcafdde60c722fe5cd28965613abafb451acb (patch) | |
tree | e42de25df996371c04d1e7921d4a467f70adf6d0 /src | |
parent | 792117312d4fafba5af68b5c2fff51c58dcd3bc0 (diff) | |
download | nginx-2f5bcafdde60c722fe5cd28965613abafb451acb.tar.gz nginx-2f5bcafdde60c722fe5cd28965613abafb451acb.zip |
QUIC: normalize header inclusion.
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/event/quic/ngx_event_quic.h | 5 | ||||
-rw-r--r-- | src/event/quic/ngx_event_quic_connection.h | 6 | ||||
-rw-r--r-- | src/event/quic/ngx_event_quic_protection.c | 3 | ||||
-rw-r--r-- | src/event/quic/ngx_event_quic_protection.h | 2 | ||||
-rw-r--r-- | src/event/quic/ngx_event_quic_streams.c | 2 | ||||
-rw-r--r-- | src/event/quic/ngx_event_quic_tokens.c | 2 | ||||
-rw-r--r-- | src/event/quic/ngx_event_quic_transport.c | 2 | ||||
-rw-r--r-- | src/http/modules/ngx_http_quic_module.c | 2 | ||||
-rw-r--r-- | src/stream/ngx_stream_quic_module.c | 2 |
9 files changed, 8 insertions, 18 deletions
diff --git a/src/event/quic/ngx_event_quic.h b/src/event/quic/ngx_event_quic.h index 66395dbcf..8a442b4b3 100644 --- a/src/event/quic/ngx_event_quic.h +++ b/src/event/quic/ngx_event_quic.h @@ -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_ */ diff --git a/src/event/quic/ngx_event_quic_connection.h b/src/event/quic/ngx_event_quic_connection.h index 992397a66..03495a684 100644 --- a/src/event/quic/ngx_event_quic_connection.h +++ b/src/event/quic/ngx_event_quic_connection.h @@ -11,12 +11,12 @@ #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> diff --git a/src/event/quic/ngx_event_quic_protection.c b/src/event/quic/ngx_event_quic_protection.c index 12dd233b8..d1801d05f 100644 --- a/src/event/quic/ngx_event_quic_protection.c +++ b/src/event/quic/ngx_event_quic_protection.c @@ -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 diff --git a/src/event/quic/ngx_event_quic_protection.h b/src/event/quic/ngx_event_quic_protection.h index a351c9b1b..7a1604c6c 100644 --- a/src/event/quic/ngx_event_quic_protection.h +++ b/src/event/quic/ngx_event_quic_protection.h @@ -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); diff --git a/src/event/quic/ngx_event_quic_streams.c b/src/event/quic/ngx_event_quic_streams.c index 1174ea11e..716550b3d 100644 --- a/src/event/quic/ngx_event_quic_streams.c +++ b/src/event/quic/ngx_event_quic_streams.c @@ -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 diff --git a/src/event/quic/ngx_event_quic_tokens.c b/src/event/quic/ngx_event_quic_tokens.c index cbfc356d7..b896611e3 100644 --- a/src/event/quic/ngx_event_quic_tokens.c +++ b/src/event/quic/ngx_event_quic_tokens.c @@ -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 diff --git a/src/event/quic/ngx_event_quic_transport.c b/src/event/quic/ngx_event_quic_transport.c index 27dbf92af..2c952177c 100644 --- a/src/event/quic/ngx_event_quic_transport.c +++ b/src/event/quic/ngx_event_quic_transport.c @@ -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 diff --git a/src/http/modules/ngx_http_quic_module.c b/src/http/modules/ngx_http_quic_module.c index 5282bf4bb..b7661b42c 100644 --- a/src/http/modules/ngx_http_quic_module.c +++ b/src/http/modules/ngx_http_quic_module.c @@ -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); diff --git a/src/stream/ngx_stream_quic_module.c b/src/stream/ngx_stream_quic_module.c index 6a67680b2..6567b16cf 100644 --- a/src/stream/ngx_stream_quic_module.c +++ b/src/stream/ngx_stream_quic_module.c @@ -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); |