Use S2N_SMALL_FRAGMENT_LENGTH in AES-GCM tests
Using the default fragment length was causing the test to run for
too long(causing TravisCI timeouts). We don't lose any test coverage.
Prior to upgrading max outgoing record size to 8k, this test was using
S2N_SMALL_FRAGMENT_LENGTH.
@@ -44,7 +44,7 @@ static int setup_server_keys(struct s2n_connection *server_conn, struct s2n_blob
int main(int argc, char **argv)
{
struct s2n_connection *conn;
- uint8_t random_data[S2N_DEFAULT_FRAGMENT_LENGTH + 1];
+ uint8_t random_data[S2N_SMALL_FRAGMENT_LENGTH + 1];
uint8_t aes128_key[] = "123456789012345";
uint8_t aes256_key[] = "1234567890123456789012345678901";
struct s2n_blob aes128 = {.data = aes128_key,.size = sizeof(aes128_key) };
@@ -64,12 +64,13 @@ int main(int argc, char **argv)
conn->initial.cipher_suite->record_alg = &s2n_record_alg_aes128_gcm;
EXPECT_SUCCESS(setup_server_keys(conn, &aes128));
- int max_fragment = S2N_DEFAULT_FRAGMENT_LENGTH;
+ int max_fragment = S2N_SMALL_FRAGMENT_LENGTH;
for (int i = 0; i < max_fragment; i++) {
struct s2n_blob in = {.data = random_data,.size = i };
int bytes_written;
EXPECT_SUCCESS(s2n_connection_wipe(conn));
+ EXPECT_SUCCESS(s2n_connection_prefer_low_latency(conn));
conn->server_protocol_version = S2N_TLS12;
conn->client_protocol_version = S2N_TLS12;
conn->actual_protocol_version = S2N_TLS12;
@@ -231,6 +232,8 @@ int main(int argc, char **argv)
int bytes_written;
EXPECT_SUCCESS(s2n_connection_wipe(conn));
+ /* Set prefer low latency for S2N_SMALL_FRAGMENT_LENGTH for */
+ EXPECT_SUCCESS(s2n_connection_prefer_low_latency(conn));
conn->server_protocol_version = S2N_TLS12;
conn->client_protocol_version = S2N_TLS12;
conn->actual_protocol_version = S2N_TLS12;
