Mercurial > hg > nginx-quic
annotate src/event/ngx_event_quic.h @ 7646:01dc595de244 quic
Cleanup.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 28 Feb 2020 13:09:52 +0300 |
parents | 7ee1ada04c8a |
children | 3cb4f16426a5 |
rev | line source |
---|---|
7633
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 |
7636
53a5cdbe500c
QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7635
diff
changeset
|
11 #include <ngx_event_openssl.h> |
53a5cdbe500c
QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7635
diff
changeset
|
12 |
53a5cdbe500c
QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7635
diff
changeset
|
13 |
7641
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
14 typedef struct { |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
15 ngx_str_t secret; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
16 ngx_str_t key; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
17 ngx_str_t iv; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
18 ngx_str_t hp; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
19 } ngx_quic_secret_t; |
7633
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 |
7634 | 21 |
7641
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
22 struct ngx_quic_connection_s { |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
23 ngx_str_t scid; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
24 ngx_str_t dcid; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
25 ngx_str_t token; |
7633
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 |
7641
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
27 ngx_quic_secret_t client_in; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
28 ngx_quic_secret_t client_hs; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
29 ngx_quic_secret_t client_ad; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
30 ngx_quic_secret_t server_in; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
31 ngx_quic_secret_t server_hs; |
72f632f90a17
Introduced ngx_quic_secret_t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7637
diff
changeset
|
32 ngx_quic_secret_t server_ad; |
7633
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 |
7636
53a5cdbe500c
QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7635
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:
7635
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:
7635
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:
7635
diff
changeset
|
39 |
7637
4daf03d2bd0a
OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7636
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:
7636
diff
changeset
|
41 const EVP_MD *digest, const u_char *secret, size_t secret_len, |
4daf03d2bd0a
OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7636
diff
changeset
|
42 const u_char *salt, size_t salt_len); |
4daf03d2bd0a
OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7636
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:
7636
diff
changeset
|
44 const EVP_MD *digest, const u_char *prk, size_t prk_len, |
4daf03d2bd0a
OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7636
diff
changeset
|
45 const u_char *info, size_t info_len); |
4daf03d2bd0a
OpenSSL compatibility.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7636
diff
changeset
|
46 |
7645
7ee1ada04c8a
Generic function for HKDF expansion.
Vladimir Homutov <vl@nginx.com>
parents:
7644
diff
changeset
|
47 ngx_int_t ngx_quic_hkdf_expand(ngx_connection_t *c, const EVP_MD *digest, |
7646 | 48 ngx_str_t *out, ngx_str_t *label, const uint8_t *prk, size_t prk_len); |
7645
7ee1ada04c8a
Generic function for HKDF expansion.
Vladimir Homutov <vl@nginx.com>
parents:
7644
diff
changeset
|
49 |
7643
76e29ff31cd3
AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents:
7641
diff
changeset
|
50 ngx_int_t ngx_quic_tls_open(ngx_connection_t *c, |
7646 | 51 const EVP_CIPHER *cipher, ngx_quic_secret_t *s, ngx_str_t *out, |
7643
76e29ff31cd3
AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents:
7641
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:
7641
diff
changeset
|
53 ngx_int_t ngx_quic_tls_seal(ngx_connection_t *c, |
7646 | 54 const EVP_CIPHER *cipher, ngx_quic_secret_t *s, ngx_str_t *out, |
7643
76e29ff31cd3
AEAD routines, introduced ngx_quic_tls_open()/ngx_quic_tls_seal().
Sergey Kandaurov <pluknet@nginx.com>
parents:
7641
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:
7641
diff
changeset
|
56 |
7644
a9ff4392ecde
QUIC header protection routines, introduced ngx_quic_tls_hp().
Sergey Kandaurov <pluknet@nginx.com>
parents:
7643
diff
changeset
|
57 ngx_int_t |
a9ff4392ecde
QUIC header protection routines, introduced ngx_quic_tls_hp().
Sergey Kandaurov <pluknet@nginx.com>
parents:
7643
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:
7643
diff
changeset
|
59 ngx_quic_secret_t *s, u_char *out, u_char *in); |
7636
53a5cdbe500c
QUIC add_handshake_data callback, varint routines.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7635
diff
changeset
|
60 |
7633
5d91389e0fd3
Initial QUIC support in http.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
61 #endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */ |