| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
#include "tls/s2n_crypto_constants.h" |
| 19 |
#include "tls/s2n_quic_support.h" |
| 20 |
#include "utils/s2n_blob.h" |
| 21 |
#include "utils/s2n_result.h" |
| 22 |
|
| 23 |
|
| 24 |
#include "crypto/s2n_tls13_keys.h" |
| 25 |
|
| 26 |
typedef enum { |
| 27 |
S2N_NONE_SECRET = 0, |
| 28 |
S2N_EARLY_SECRET, |
| 29 |
S2N_HANDSHAKE_SECRET, |
| 30 |
S2N_MASTER_SECRET |
| 31 |
} s2n_extract_secret_type_t; |
| 32 |
|
| 33 |
struct s2n_tls13_secrets { |
| 34 |
uint8_t extract_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 35 |
|
| 36 |
uint8_t client_early_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 37 |
uint8_t client_handshake_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 38 |
uint8_t server_handshake_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 39 |
|
| 40 |
uint8_t client_app_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 41 |
uint8_t server_app_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 42 |
uint8_t resumption_master_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 43 |
uint8_t exporter_master_secret[S2N_TLS13_SECRET_MAX_LEN]; |
| 44 |
|
| 45 |
s2n_extract_secret_type_t extract_secret_type; |
| 46 |
}; |
| 47 |
|
| 48 |
S2N_RESULT s2n_tls13_empty_transcripts_init(); |
| 49 |
|
| 50 |
S2N_RESULT s2n_tls13_secrets_update(struct s2n_connection *conn); |
| 51 |
S2N_RESULT s2n_tls13_secrets_get(struct s2n_connection *conn, s2n_extract_secret_type_t secret_type, |
| 52 |
s2n_mode mode, struct s2n_blob *secret); |
| 53 |
S2N_RESULT s2n_tls13_secrets_clean(struct s2n_connection *conn); |
| 54 |
|
| 55 |
S2N_RESULT s2n_derive_binder_key(struct s2n_psk *psk, struct s2n_blob *output); |
| 56 |
S2N_RESULT s2n_derive_resumption_master_secret(struct s2n_connection *conn); |
| 57 |
S2N_RESULT s2n_derive_exporter_master_secret(struct s2n_connection *conn, struct s2n_blob *output); |