@@ -63,13 +63,13 @@ int main(int argc, char **argv)
63
63
uint8_t mac_key [] = "sample mac key" ;
64
64
struct s2n_blob fixed_iv = {.data = mac_key ,.size = sizeof (mac_key ) };
65
65
struct s2n_hmac_state check_mac ;
66
- uint8_t random_data [S2N_MAXIMUM_FRAGMENT_LENGTH + 1 ];
66
+ uint8_t random_data [S2N_DEFAULT_FRAGMENT_LENGTH + 1 ];
67
67
68
68
BEGIN_TEST ();
69
69
70
70
EXPECT_SUCCESS (s2n_init ());
71
71
EXPECT_SUCCESS (s2n_hmac_init (& check_mac , S2N_HMAC_SHA1 , fixed_iv .data , fixed_iv .size ));
72
- EXPECT_SUCCESS (s2n_get_random_data (random_data , S2N_MAXIMUM_FRAGMENT_LENGTH + 1 ));
72
+ EXPECT_SUCCESS (s2n_get_random_data (random_data , S2N_DEFAULT_FRAGMENT_LENGTH + 1 ));
73
73
EXPECT_NOT_NULL (conn = s2n_connection_new (S2N_SERVER ));
74
74
75
75
/* Peer and we are in sync */
@@ -79,17 +79,17 @@ int main(int argc, char **argv)
79
79
conn -> active .cipher_suite = & s2n_null_cipher_suite ;
80
80
conn -> actual_protocol_version = S2N_TLS11 ;
81
81
82
- for (int i = 0 ; i <= S2N_MAXIMUM_FRAGMENT_LENGTH + 1 ; i ++ ) {
82
+ for (int i = 0 ; i <= S2N_DEFAULT_FRAGMENT_LENGTH + 1 ; i ++ ) {
83
83
struct s2n_blob in = {.data = random_data ,.size = i };
84
84
int bytes_written ;
85
85
86
86
EXPECT_SUCCESS (s2n_stuffer_wipe (& conn -> out ));
87
87
EXPECT_SUCCESS (bytes_written = s2n_record_write (conn , TLS_APPLICATION_DATA , & in ));
88
88
89
- if (i < S2N_MAXIMUM_FRAGMENT_LENGTH ) {
89
+ if (i < S2N_DEFAULT_FRAGMENT_LENGTH ) {
90
90
EXPECT_EQUAL (bytes_written , i );
91
91
} else {
92
- EXPECT_EQUAL (bytes_written , S2N_MAXIMUM_FRAGMENT_LENGTH );
92
+ EXPECT_EQUAL (bytes_written , S2N_DEFAULT_FRAGMENT_LENGTH );
93
93
}
94
94
95
95
EXPECT_EQUAL (conn -> out .blob .data [0 ], TLS_APPLICATION_DATA );
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
119
119
conn -> active .cipher_suite = & s2n_null_cipher_suite ;
120
120
conn -> actual_protocol_version = S2N_TLS11 ;
121
121
122
- for (int i = 0 ; i <= S2N_MAXIMUM_FRAGMENT_LENGTH + 1 ; i ++ ) {
122
+ for (int i = 0 ; i <= S2N_DEFAULT_FRAGMENT_LENGTH + 1 ; i ++ ) {
123
123
struct s2n_blob in = {.data = random_data ,.size = i };
124
124
int bytes_written ;
125
125
@@ -129,10 +129,10 @@ int main(int argc, char **argv)
129
129
EXPECT_SUCCESS (s2n_stuffer_wipe (& conn -> out ));
130
130
EXPECT_SUCCESS (bytes_written = s2n_record_write (conn , TLS_APPLICATION_DATA , & in ));
131
131
132
- if (i < S2N_MAXIMUM_FRAGMENT_LENGTH - 20 ) {
132
+ if (i < S2N_DEFAULT_FRAGMENT_LENGTH - 20 ) {
133
133
EXPECT_EQUAL (bytes_written , i );
134
134
} else {
135
- EXPECT_EQUAL (bytes_written , S2N_MAXIMUM_FRAGMENT_LENGTH - 20 );
135
+ EXPECT_EQUAL (bytes_written , S2N_DEFAULT_FRAGMENT_LENGTH - 20 );
136
136
}
137
137
138
138
uint16_t predicted_length = bytes_written + 20 ;
@@ -200,7 +200,7 @@ int main(int argc, char **argv)
200
200
conn -> actual_protocol_version = S2N_TLS10 ;
201
201
conn -> active .cipher_suite = & mock_block_cipher_suite ;
202
202
203
- uint16_t max_aligned_fragment = S2N_MAXIMUM_FRAGMENT_LENGTH - (S2N_MAXIMUM_FRAGMENT_LENGTH % 16 );
203
+ uint16_t max_aligned_fragment = S2N_DEFAULT_FRAGMENT_LENGTH - (S2N_DEFAULT_FRAGMENT_LENGTH % 16 );
204
204
for (int i = 0 ; i <= max_aligned_fragment + 1 ; i ++ ) {
205
205
struct s2n_blob in = {.data = random_data ,.size = i };
206
206
int bytes_written ;
@@ -268,7 +268,7 @@ int main(int argc, char **argv)
268
268
conn -> actual_protocol_version = S2N_TLS11 ;
269
269
conn -> active .cipher_suite = & mock_block_cipher_suite ;
270
270
271
- max_aligned_fragment = S2N_MAXIMUM_FRAGMENT_LENGTH - (S2N_MAXIMUM_FRAGMENT_LENGTH % 16 );
271
+ max_aligned_fragment = S2N_DEFAULT_FRAGMENT_LENGTH - (S2N_DEFAULT_FRAGMENT_LENGTH % 16 );
272
272
for (int i = 0 ; i <= max_aligned_fragment + 1 ; i ++ ) {
273
273
struct s2n_blob in = {.data = random_data ,.size = i };
274
274
int bytes_written ;
0 commit comments