| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
#include <stdint.h> |
| 19 |
|
| 20 |
#include "api/s2n.h" |
| 21 |
#include "stuffer/s2n_stuffer.h" |
| 22 |
#include "tls/extensions/s2n_extension_list.h" |
| 23 |
#include "tls/s2n_crypto_constants.h" |
| 24 |
#include "utils/s2n_array.h" |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
struct s2n_client_hello { |
| 30 |
struct s2n_blob raw_message; |
| 31 |
uint8_t random[S2N_TLS_RANDOM_DATA_LEN]; |
| 32 |
|
| 33 |
s2n_parsed_extensions_list extensions; |
| 34 |
struct s2n_blob cipher_suites; |
| 35 |
struct s2n_blob session_id; |
| 36 |
struct s2n_blob compression_methods; |
| 37 |
|
| 38 |
uint8_t legacy_version; |
| 39 |
|
| 40 |
uint8_t legacy_record_version; |
| 41 |
|
| 42 |
unsigned int record_version_recorded : 1; |
| 43 |
|
| 44 |
unsigned int callback_invoked : 1; |
| 45 |
unsigned int callback_async_blocked : 1; |
| 46 |
unsigned int callback_async_done : 1; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
unsigned int parsed : 1; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
unsigned int sslv2 : 1; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
unsigned int alloced : 1; |
| 73 |
}; |
| 74 |
|
| 75 |
int s2n_client_hello_free_raw_message(struct s2n_client_hello *client_hello); |
| 76 |
|
| 77 |
struct s2n_client_hello *s2n_connection_get_client_hello(struct s2n_connection *conn); |
| 78 |
|
| 79 |
ssize_t s2n_client_hello_get_raw_message_length(struct s2n_client_hello *ch); |
| 80 |
ssize_t s2n_client_hello_get_raw_message(struct s2n_client_hello *ch, uint8_t *out, uint32_t max_length); |
| 81 |
|
| 82 |
ssize_t s2n_client_hello_get_cipher_suites_length(struct s2n_client_hello *ch); |
| 83 |
ssize_t s2n_client_hello_get_cipher_suites(struct s2n_client_hello *ch, uint8_t *out, uint32_t max_length); |
| 84 |
|
| 85 |
int s2n_client_hello_get_parsed_extension(s2n_tls_extension_type extension_type, |
| 86 |
s2n_parsed_extensions_list *parsed_extension_list, s2n_parsed_extension **parsed_extension); |
| 87 |
ssize_t s2n_client_hello_get_extensions_length(struct s2n_client_hello *ch); |
| 88 |
ssize_t s2n_client_hello_get_extensions(struct s2n_client_hello *ch, uint8_t *out, uint32_t max_length); |
| 89 |
|
| 90 |
int s2n_client_hello_get_random(struct s2n_client_hello *ch, uint8_t *out, uint32_t max_length); |