Skip to content

Commit 56a3bbd

Browse files
committed
ssl: Fix test case interopability
1 parent 28be25a commit 56a3bbd

File tree

2 files changed

+34
-28
lines changed

2 files changed

+34
-28
lines changed

lib/ssl/src/tls_v1.erl

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
rsa_schemes/0,
6969
groups/0,
7070
groups/1,
71+
pqc_groups/0,
72+
ec_groups/0,
7173
group_to_enum/1,
7274
enum_to_group/1,
7375
default_groups/0,
@@ -1248,37 +1250,21 @@ ecc_curves(Version) when is_tuple(Version) ->
12481250
ecc_curves(TLSCurves);
12491251
ecc_curves(TLSCurves) ->
12501252
[pubkey_cert_records:namedCurves(Curve) || Curve <- TLSCurves].
1251-
1253+
12521254
groups() ->
12531255
TLSGroups = groups(all),
12541256
groups(TLSGroups).
12551257

12561258
-spec groups(all | default | TLSGroups :: list()) -> [ssl:group()].
12571259
groups(all) ->
12581260
default_pqc_hybrid_groups() ++
1259-
[x25519,
1260-
x448,
1261-
secp521r1,
1262-
secp384r1,
1263-
secp256r1,
1264-
brainpoolP256r1tls13,
1265-
brainpoolP384r1tls13,
1266-
brainpoolP512r1tls13
1267-
] ++
1261+
ec_groups() ++
12681262
other_pqc_hybrid_groups() ++
12691263
pqc_plain_groups() ++
12701264
dhe_groups();
12711265
groups(default) ->
1272-
default_pqc_hybrid_groups() ++
1273-
[x25519,
1274-
x448,
1275-
secp521r1,
1276-
secp384r1,
1277-
secp256r1,
1278-
brainpoolP512r1tls13,
1279-
brainpoolP384r1tls13,
1280-
brainpoolP256r1tls13
1281-
];
1266+
groups(default_pqc_hybrid_groups() ++
1267+
ec_groups());
12821268
groups(TLSGroups) when is_list(TLSGroups) ->
12831269
CryptoGroups = crypto_supported_groups(),
12841270
lists:filter(fun(x25519mlkem768) ->
@@ -1293,6 +1279,21 @@ groups(TLSGroups) when is_list(TLSGroups) ->
12931279
(Group) ->
12941280
proplists:get_bool(maybe_group_to_curve(Group), CryptoGroups)
12951281
end, TLSGroups).
1282+
ec_groups() ->
1283+
[x25519,
1284+
x448,
1285+
secp521r1,
1286+
secp384r1,
1287+
secp256r1,
1288+
brainpoolP512r1tls13,
1289+
brainpoolP384r1tls13,
1290+
brainpoolP256r1tls13
1291+
].
1292+
1293+
pqc_groups() ->
1294+
default_pqc_hybrid_groups() ++
1295+
other_pqc_hybrid_groups() ++
1296+
pqc_plain_groups().
12961297

12971298
default_pqc_hybrid_groups() ->
12981299
[x25519mlkem768].

lib/ssl/test/openssl_session_ticket_SUITE.erl

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,29 +214,29 @@ openssl_server_hrr_multiple_tickets(Config) when is_list(Config) ->
214214
openssl_server_early_data_basic() ->
215215
[{doc,"Test early data (erlang client - openssl server)"}].
216216
openssl_server_early_data_basic(Config) when is_list(Config) ->
217-
erlang_client_auto_ticket(Config, [{supported_groups, one_supported_grop()}], [], true).
217+
erlang_client_auto_ticket(Config, [{supported_groups, one_supported_grop(Config)}], [], true).
218218

219219
openssl_server_early_data_big() ->
220220
[{doc,"Send more early data than the max_early_data_size (erlang client - openssl server)"}].
221221
openssl_server_early_data_big(Config) when is_list(Config) ->
222-
erlang_client_auto_ticket(Config, [{supported_groups, one_supported_grop()},
222+
erlang_client_auto_ticket(Config, [{supported_groups, one_supported_grop(Config)},
223223
{early_data, <<"SampleData">>}], [{early_data, 5}], false).
224-
224+
225225
openssl_server_early_data_manual() ->
226226
[{doc,"Test sending early data - manual ticket handling (erlang client - openssl server)"}].
227227
openssl_server_early_data_manual(Config) when is_list(Config) ->
228-
erlang_client_manual_ticket(Config, [{supported_groups, one_supported_grop()}],
228+
erlang_client_manual_ticket(Config, [{supported_groups, one_supported_grop(Config)}],
229229
[{early_data, <<"SampleData">>}], [{early_data, 16384}]).
230230

231231
openssl_server_early_data_manual_2_tickets() ->
232232
[{doc,"Test sending early data - manual ticket handling, 2 tickets (erlang client - openssl server)"}].
233233
openssl_server_early_data_manual_2_tickets(Config) when is_list(Config) ->
234-
erlang_client_manual_ticket(Config, [{supported_groups, one_supported_grop()}],
234+
erlang_client_manual_ticket(Config, [{supported_groups, one_supported_grop(Config)}],
235235
[{early_data, <<"SampleData">>}], [{early_data, 16384}]).
236236
openssl_server_early_data_manual_2_chacha_tickets() ->
237237
[{doc,"Test sending early data - manual ticket handling, 2 tickets - chacha (erlang client - openssl server)"}].
238238
openssl_server_early_data_manual_2_chacha_tickets(Config) when is_list(Config) ->
239-
erlang_client_manual_ticket(Config, [{supported_groups, one_supported_grop()}, {ciphers, ["TLS_CHACHA20_POLY1305_SHA256"]}],
239+
erlang_client_manual_ticket(Config, [{supported_groups, one_supported_grop()}, {ciphers, ["TLS_CHACHA20_POLY1305_SHA256"]}],
240240
[{early_data, <<"SampleData">>}], [{early_data, 16384}]).
241241

242242
openssl_server_early_data_manual_big() ->
@@ -434,8 +434,13 @@ create_request(File, EarlyData) ->
434434
io:format(S, "~s", [binary_to_list(EarlyData)]),
435435
file:close(S).
436436

437-
one_supported_grop() ->
438-
[hd(ssl:groups())].
437+
one_supported_grop(Config) ->
438+
case proplists:get_value(openssl_version, Config) of
439+
"OpenSSL 3.5" ++ _ ->
440+
[hd(tls_v1:groups((tls_v1:pqc_groups())))];
441+
_ ->
442+
[hd(tls_v1:groups(tls_v1:ec_groups()))]
443+
end.
439444

440445
verify_early_data([]) ->
441446
[];

0 commit comments

Comments
 (0)