Skip to content

Commit

Permalink
prep for auto gen fix
Browse files Browse the repository at this point in the history
  • Loading branch information
toidiu committed Sep 18, 2024
1 parent aaaa2e9 commit 09c463a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/s2n_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "tls/s2n_tls13.h"

int test_count;
const char *s2n_auto_gen_old_default_security_policy();

bool s2n_use_color_in_output = true;

Expand Down
12 changes: 12 additions & 0 deletions tests/testlib/s2n_security_policy_testlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* permissions and limitations under the License.
*/

#include "crypto/s2n_fips.h"
#include "s2n_testlib.h"
#include "utils/s2n_safety.h"

Expand Down Expand Up @@ -40,3 +41,14 @@ const struct s2n_security_policy security_policy_test_tls13_retry = {
.certificate_signature_preferences = &s2n_certificate_signature_preferences_20201110,
.ecc_preferences = &ecc_preferences_for_retry,
};

const char* s2n_auto_gen_old_default_security_policy()
{
if (s2n_use_default_tls13_config()) {
return "20240503";
} else if (s2n_is_in_fips_mode()) {
return "20240502";
} else {
return "20240501";
}
}
4 changes: 2 additions & 2 deletions tests/unit/s2n_config_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int main(int argc, char **argv)
EXPECT_NOT_NULL(config = s2n_config_new());
EXPECT_NOT_NULL(default_config = s2n_fetch_default_config());

/* s2n_config_new() matches s2n_fetch_default_config() */
/* s2n_config_new matches s2n_fetch_default_config() */
EXPECT_EQUAL(default_config->security_policy, config->security_policy);
EXPECT_EQUAL(default_config->security_policy->signature_preferences, config->security_policy->signature_preferences);
EXPECT_EQUAL(default_config->client_cert_auth_type, config->client_cert_auth_type);
Expand Down Expand Up @@ -150,7 +150,7 @@ int main(int argc, char **argv)
}
};

/* Test for s2n_config_new() and tls 1.3 behavior */
/* Test for s2n_config_new and tls 1.3 behavior */
{
if (!s2n_is_in_fips_mode()) {
struct s2n_config *config = NULL;
Expand Down

0 comments on commit 09c463a

Please sign in to comment.