Skip to content

Commit

Permalink
test: remove load system certs functionality for s2n_default_tls13_co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
toidiu committed Nov 14, 2024
1 parent 2ba3dda commit 04fe83e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
7 changes: 4 additions & 3 deletions tests/fuzz/s2n_certificate_extensions_parse_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ static const uint8_t TLS_VERSIONS[] = {S2N_TLS13};

int s2n_fuzz_init(int *argc, char **argv[])
{
/* Initialize the trust store */
POSIX_GUARD_RESULT(s2n_config_testing_defaults_init_tls13_certs());
POSIX_GUARD(s2n_enable_tls13_in_test());
return S2N_SUCCESS;
}

Expand All @@ -67,8 +64,12 @@ int s2n_fuzz_test(const uint8_t *buf, size_t len)
POSIX_GUARD(s2n_stuffer_alloc(&fuzz_stuffer, len));
POSIX_GUARD(s2n_stuffer_write_bytes(&fuzz_stuffer, buf, len));

DEFER_CLEANUP(struct s2n_config *config = s2n_config_new(), s2n_config_ptr_free);
POSIX_GUARD(s2n_config_set_cipher_preferences(config, "20240503"));

struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT);
POSIX_ENSURE_REF(client_conn);
POSIX_GUARD(s2n_connection_set_config(client_conn, config));

/* Pull a byte off the libfuzzer input and use it to set parameters */
uint8_t randval = 0;
Expand Down
6 changes: 0 additions & 6 deletions tls/s2n_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,6 @@ int s2n_config_defaults_init(void)
return S2N_SUCCESS;
}

S2N_RESULT s2n_config_testing_defaults_init_tls13_certs(void)
{
RESULT_GUARD_POSIX(s2n_config_load_system_certs(&s2n_default_tls13_config));
return S2N_RESULT_OK;
}

void s2n_wipe_static_configs(void)
{
s2n_config_cleanup(&s2n_default_fips_config);
Expand Down
1 change: 0 additions & 1 deletion tls/s2n_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ struct s2n_config {
S2N_CLEANUP_RESULT s2n_config_ptr_free(struct s2n_config **config);

int s2n_config_defaults_init(void);
S2N_RESULT s2n_config_testing_defaults_init_tls13_certs(void);
struct s2n_config *s2n_fetch_default_config(void);
int s2n_config_set_unsafe_for_testing(struct s2n_config *config);

Expand Down

0 comments on commit 04fe83e

Please sign in to comment.