-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssl: Avoid unnecessary duplicates #9288
ssl: Avoid unnecessary duplicates #9288
Conversation
CT Test Results 1 files 11 suites 4m 4s ⏱️ Results for commit 05bced8. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested, but in my mind produces the same result and avoids the use of lists:reverse/1
:
signature_schemes_1_2(SigAlgs) ->
Schemes = lists:filtermap(fun
(Alg) when is_atom(Alg) ->
case scheme_to_components(Alg) of
{Hash, Sign = rsa_pss_pss, _} ->
{true, {Hash, Sign}};
{Hash, Sign = rsa_pss_rsae, _} ->
{true, {Hash, Sign}};
%% TLS-1.2 do not constraint the
%% curve, however must be one
%% present in "supported groups" (eccs)
{Hash, ecdsa = Sign, _} ->
{true, {Hash, Sign}};
{Hash, Sign, undefined} ->
{true, {Hash, format_sign(Sign)}};
{_, _, _} ->
false
end;
(_Alg) ->
true
end, SigAlgs),
%% Make sure that if ECDSA TLS-1.2 names are specified do not duplicate them
%% earlier in list by allowing TLS-1.3 schemes to be interpreted as TLS-1.2 algs
%% unless the ECDSA TLS-1.2 representation is missing and we want to work around it.
lists:uniq(Schemes).
345d22d
to
f58740c
Compare
f58740c
to
05bced8
Compare
This solution will not preserver the the order of the initial configuration if the TLS-1.2 version names are configured by the user, which I think it should. The workaround will perhaps make these algorithms more preferred with the tradeoff that interoperability is better. But if the user configures something explicitly I think we should adhere to that. These lists are fairly small so I do not think the extra reverse is a big deal in the bigger picture. |
No description provided.