Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Support DEFAU…
Browse files Browse the repository at this point in the history
…LT keyword and '-' prefix in SSL_CTX_set1_groups_list()
  • Loading branch information
fwh-dc committed Oct 31, 2024
1 parent 71cd2a4 commit 7065130
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/sslapitest.c
Original file line number Diff line number Diff line change
Expand Up @@ -9782,22 +9782,30 @@ static int test_configuration_of_groups(void)
goto end;

default_groups_len = ctx->ext.supported_groups_default_len;

#if (!defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH))
if (!TEST_size_t_gt(default_groups_len, 0)
|| !TEST_int_gt(SSL_CTX_set1_groups_list(ctx, "DEFAULT"), 0)
#else
if (!TEST_size_t_eq(default_groups_len, 0)
|| !TEST_int_eq(SSL_CTX_set1_groups_list(ctx, "DEFAULT"), 0)
#endif
|| !TEST_size_t_eq(ctx->ext.supportedgroups_len, default_groups_len))
goto end;

#if (!defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH))
if (!TEST_int_gt(SSL_CTX_set1_groups_list(ctx, "DEFAULT:-?P-256"), 0)
#ifndef OPENSSL_NO_EC
#else
if (!TEST_int_eq(SSL_CTX_set1_groups_list(ctx, "DEFAULT:-?P-256"), 0)
#endif
#if !defined(OPENSSL_NO_EC)
|| !TEST_size_t_eq(ctx->ext.supportedgroups_len, default_groups_len - 1)
#else
|| !TEST_size_t_eq(ctx->ext.supportedgroups_len, default_groups_len)
#endif
)
goto end;

#ifndef OPENSSL_NO_EC
#if !defined(OPENSSL_NO_EC)
if (!TEST_int_gt(SSL_CTX_set1_groups_list(ctx, "?P-256:?P-521:-?P-256"), 0)
|| !TEST_size_t_eq(ctx->ext.supportedgroups_len, 1)
|| !TEST_int_eq(ctx->ext.supportedgroups[0], OSSL_TLS_GROUP_ID_secp521r1)
Expand Down

0 comments on commit 7065130

Please sign in to comment.