annotate src/event/ngx_event_quic.h @ 8180:01dc595de244 quic

Cleanup.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 28 Feb 2020 13:09:52 +0300
parents 7ee1ada04c8a
children 3cb4f16426a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8167
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
1
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
2 /*
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
3 *
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
4 */
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
5
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
6
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
7 #ifndef _NGX_EVENT_QUIC_H_INCLUDED_
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
8 #define _NGX_EVENT_QUIC_H_INCLUDED_
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
9
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
10
8170
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
11 #include <ngx_event_openssl.h>
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
12
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
13
8175
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
14 typedef struct {
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
15 ngx_str_t secret;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
16 ngx_str_t key;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
17 ngx_str_t iv;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
18 ngx_str_t hp;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
19 } ngx_quic_secret_t;
8167
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
20
8168
b507592c15a7 Server Initial Keys.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8167
diff changeset
21
8175
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
22 struct ngx_quic_connection_s {
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
23 ngx_str_t scid;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
24 ngx_str_t dcid;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
25 ngx_str_t token;
8167
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
26
8175
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
27 ngx_quic_secret_t client_in;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
28 ngx_quic_secret_t client_hs;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
29 ngx_quic_secret_t client_ad;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
30 ngx_quic_secret_t server_in;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
31 ngx_quic_secret_t server_hs;
72f632f90a17 Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8171
diff changeset
32 ngx_quic_secret_t server_ad;
8167
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
33 };
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
34
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
35
8170
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
36 uint64_t ngx_quic_parse_pn(u_char **pos, ngx_int_t len, u_char *mask);
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
37 uint64_t ngx_quic_parse_int(u_char **pos);
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
38 void ngx_quic_build_int(u_char **pos, uint64_t value);
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
39
8171
4daf03d2bd0a OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8170
diff changeset
40 ngx_int_t ngx_hkdf_extract(u_char *out_key, size_t *out_len,
4daf03d2bd0a OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8170
diff changeset
41 const EVP_MD *digest, const u_char *secret, size_t secret_len,
4daf03d2bd0a OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8170
diff changeset
42 const u_char *salt, size_t salt_len);
4daf03d2bd0a OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8170
diff changeset
43 ngx_int_t ngx_hkdf_expand(u_char *out_key, size_t out_len,
4daf03d2bd0a OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8170
diff changeset
44 const EVP_MD *digest, const u_char *prk, size_t prk_len,
4daf03d2bd0a OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8170
diff changeset
45 const u_char *info, size_t info_len);
4daf03d2bd0a OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8170
diff changeset
46
8179
7ee1ada04c8a Generic function for HKDF expansion.
Vladimir Homutov <vl@nginx.com>
parents: 8178
diff changeset
47 ngx_int_t ngx_quic_hkdf_expand(ngx_connection_t *c, const EVP_MD *digest,
8180
01dc595de244 Cleanup.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8179
diff changeset
48 ngx_str_t *out, ngx_str_t *label, const uint8_t *prk, size_t prk_len);
8179
7ee1ada04c8a Generic function for HKDF expansion.
Vladimir Homutov <vl@nginx.com>
parents: 8178
diff changeset
49
8177
76e29ff31cd3 AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8175
diff changeset
50 ngx_int_t ngx_quic_tls_open(ngx_connection_t *c,
8180
01dc595de244 Cleanup.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8179
diff changeset
51 const EVP_CIPHER *cipher, ngx_quic_secret_t *s, ngx_str_t *out,
8177
76e29ff31cd3 AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8175
diff changeset
52 u_char *nonce, ngx_str_t *in, ngx_str_t *ad);
76e29ff31cd3 AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8175
diff changeset
53 ngx_int_t ngx_quic_tls_seal(ngx_connection_t *c,
8180
01dc595de244 Cleanup.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8179
diff changeset
54 const EVP_CIPHER *cipher, ngx_quic_secret_t *s, ngx_str_t *out,
8177
76e29ff31cd3 AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8175
diff changeset
55 u_char *nonce, ngx_str_t *in, ngx_str_t *ad);
76e29ff31cd3 AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8175
diff changeset
56
8178
a9ff4392ecde QUIC header protection routines, introduced ngx_quic_tls_hp().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8177
diff changeset
57 ngx_int_t
a9ff4392ecde QUIC header protection routines, introduced ngx_quic_tls_hp().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8177
diff changeset
58 ngx_quic_tls_hp(ngx_connection_t *c, const EVP_CIPHER *cipher,
a9ff4392ecde QUIC header protection routines, introduced ngx_quic_tls_hp().
Sergey Kandaurov <pluknet@nginx.com>
parents: 8177
diff changeset
59 ngx_quic_secret_t *s, u_char *out, u_char *in);
8170
53a5cdbe500c QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents: 8169
diff changeset
60
8167
5d91389e0fd3 Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
61 #endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */