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.
This commit is contained in:
Sergey Kandaurov
2021-04-13 12:38:34 +03:00
parent 792117312d
commit 2f5bcafdde
9 changed files with 8 additions and 18 deletions

View 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_ */

View File

@@ -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>

View 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

View 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);

View 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

View 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

View 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

View 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);

View 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);