| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
#include "stuffer/s2n_stuffer.h" |
| 19 |
#include "tls/extensions/s2n_extension_type.h" |
| 20 |
|
| 21 |
#define S2N_PARSED_EXTENSIONS_COUNT S2N_SUPPORTED_EXTENSIONS_COUNT |
| 22 |
|
| 23 |
typedef struct { |
| 24 |
struct s2n_blob extension; |
| 25 |
uint16_t extension_type; |
| 26 |
uint16_t wire_index; |
| 27 |
unsigned processed : 1; |
| 28 |
} s2n_parsed_extension; |
| 29 |
|
| 30 |
typedef struct { |
| 31 |
s2n_parsed_extension parsed_extensions[S2N_PARSED_EXTENSIONS_COUNT]; |
| 32 |
struct s2n_blob raw; |
| 33 |
uint16_t count; |
| 34 |
} s2n_parsed_extensions_list; |
| 35 |
|
| 36 |
typedef enum { |
| 37 |
S2N_EXTENSION_LIST_CLIENT_HELLO = 0, |
| 38 |
S2N_EXTENSION_LIST_HELLO_RETRY_REQUEST, |
| 39 |
S2N_EXTENSION_LIST_SERVER_HELLO_DEFAULT, |
| 40 |
S2N_EXTENSION_LIST_SERVER_HELLO_TLS13, |
| 41 |
S2N_EXTENSION_LIST_ENCRYPTED_EXTENSIONS, |
| 42 |
S2N_EXTENSION_LIST_CERT_REQ, |
| 43 |
S2N_EXTENSION_LIST_CERTIFICATE, |
| 44 |
S2N_EXTENSION_LIST_NST, |
| 45 |
S2N_EXTENSION_LIST_ENCRYPTED_EXTENSIONS_TLS12, |
| 46 |
S2N_EXTENSION_LIST_EMPTY, |
| 47 |
S2N_EXTENSION_LIST_IDS_COUNT, |
| 48 |
} s2n_extension_list_id; |
| 49 |
|
| 50 |
int s2n_extension_list_send(s2n_extension_list_id list_type, struct s2n_connection *conn, struct s2n_stuffer *out); |
| 51 |
int s2n_extension_list_recv(s2n_extension_list_id list_type, struct s2n_connection *conn, struct s2n_stuffer *in); |
| 52 |
|
| 53 |
int s2n_extension_process(const s2n_extension_type *extension_type, struct s2n_connection *conn, |
| 54 |
s2n_parsed_extensions_list *parsed_extension_list); |
| 55 |
int s2n_extension_list_process(s2n_extension_list_id list_type, struct s2n_connection *conn, |
| 56 |
s2n_parsed_extensions_list *parsed_extension_list); |
| 57 |
int s2n_extension_list_parse(struct s2n_stuffer *in, s2n_parsed_extensions_list *parsed_extension_list); |