17
17
18
18
#include <stdint.h>
19
19
20
- #include "crypto/s2n_hash.h"
21
20
#include "crypto/s2n_hmac.h"
21
+ #include "tls/s2n_connection.h"
22
22
#include "utils/s2n_blob.h"
23
23
24
24
/* Enough to support TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, 2*SHA384_DIGEST_LEN + 2*AES256_KEY_SIZE */
25
25
#define S2N_MAX_KEY_BLOCK_LEN 160
26
26
27
- #if defined(OPENSSL_IS_AWSLC )
28
- #define S2N_LIBCRYPTO_SUPPORTS_TLS_PRF 1
29
- #else
30
- #define S2N_LIBCRYPTO_SUPPORTS_TLS_PRF 0
31
- #endif
32
-
33
27
union p_hash_state {
34
28
struct s2n_hmac_state s2n_hmac ;
35
29
struct s2n_evp_hmac_state evp_hmac ;
@@ -41,18 +35,6 @@ struct s2n_prf_working_space {
41
35
uint8_t digest1 [S2N_MAX_DIGEST_LEN ];
42
36
};
43
37
44
- /* The s2n p_hash implementation is abstracted to allow for separate implementations, using
45
- * either s2n's formally verified HMAC or OpenSSL's EVP HMAC, for use by the TLS PRF. */
46
- struct s2n_p_hash_hmac {
47
- int (* alloc )(struct s2n_prf_working_space * ws );
48
- int (* init )(struct s2n_prf_working_space * ws , s2n_hmac_algorithm alg , struct s2n_blob * secret );
49
- int (* update )(struct s2n_prf_working_space * ws , const void * data , uint32_t size );
50
- int (* final )(struct s2n_prf_working_space * ws , void * digest , uint32_t size );
51
- int (* reset )(struct s2n_prf_working_space * ws );
52
- int (* cleanup )(struct s2n_prf_working_space * ws );
53
- int (* free )(struct s2n_prf_working_space * ws );
54
- };
55
-
56
38
/* TLS key expansion results in an array of contiguous data which is then
57
39
* interpreted as the MAC, KEY and IV for the client and server.
58
40
*
@@ -75,27 +57,13 @@ struct s2n_key_material {
75
57
76
58
S2N_RESULT s2n_key_material_init (struct s2n_key_material * key_material , struct s2n_connection * conn );
77
59
78
- #include "tls/s2n_connection.h"
79
-
80
60
S2N_RESULT s2n_prf_new (struct s2n_connection * conn );
81
61
S2N_RESULT s2n_prf_wipe (struct s2n_connection * conn );
82
62
S2N_RESULT s2n_prf_free (struct s2n_connection * conn );
83
63
84
- int s2n_prf (struct s2n_connection * conn , struct s2n_blob * secret , struct s2n_blob * label , struct s2n_blob * seed_a ,
85
- struct s2n_blob * seed_b , struct s2n_blob * seed_c , struct s2n_blob * out );
86
64
int s2n_prf_calculate_master_secret (struct s2n_connection * conn , struct s2n_blob * premaster_secret );
87
- int s2n_tls_prf_master_secret (struct s2n_connection * conn , struct s2n_blob * premaster_secret );
88
- int s2n_hybrid_prf_master_secret (struct s2n_connection * conn , struct s2n_blob * premaster_secret );
89
- S2N_RESULT s2n_tls_prf_extended_master_secret (struct s2n_connection * conn , struct s2n_blob * premaster_secret , struct s2n_blob * session_hash , struct s2n_blob * sha1_hash );
90
- S2N_RESULT s2n_prf_get_digest_for_ems (struct s2n_connection * conn , struct s2n_blob * message , s2n_hash_algorithm hash_alg , struct s2n_blob * output );
65
+ int s2n_prf_hybrid_master_secret (struct s2n_connection * conn , struct s2n_blob * premaster_secret );
91
66
S2N_RESULT s2n_prf_generate_key_material (struct s2n_connection * conn , struct s2n_key_material * key_material );
92
67
int s2n_prf_key_expansion (struct s2n_connection * conn );
93
68
int s2n_prf_server_finished (struct s2n_connection * conn );
94
69
int s2n_prf_client_finished (struct s2n_connection * conn );
95
-
96
- bool s2n_libcrypto_supports_tls_prf ();
97
-
98
- S2N_RESULT s2n_custom_prf (struct s2n_connection * conn , struct s2n_blob * secret , struct s2n_blob * label ,
99
- struct s2n_blob * seed_a , struct s2n_blob * seed_b , struct s2n_blob * seed_c , struct s2n_blob * out );
100
- S2N_RESULT s2n_libcrypto_prf (struct s2n_connection * conn , struct s2n_blob * secret , struct s2n_blob * label ,
101
- struct s2n_blob * seed_a , struct s2n_blob * seed_b , struct s2n_blob * seed_c , struct s2n_blob * out );
0 commit comments