@@ -1469,10 +1469,10 @@ opt_supported_groups(UserOpts, #{versions := TlsVsns} = Opts, Env) ->
14691469
14701470opt_psk_groups (undefined , _ , _ , _ ) ->
14711471 undefined ;
1472- opt_psk_groups (# supported_groups {supported_groups = SupportedGroups }, UserOpts , Opts , _Env ) ->
1472+ opt_psk_groups (# supported_groups {supported_groups = [First | _ ] = SupportedGroups },
1473+ UserOpts , Opts , _Env ) ->
14731474 % % Version dependency already asserted when SupportedGroups is supported
1474- % % so is psk_groups
1475- First = hd (SupportedGroups ),
1475+ % % hence so is psk_groups
14761476 case get_opt_list (psk_groups , [First ], UserOpts , Opts ) of
14771477 {default , Default } ->
14781478 Default ;
@@ -1495,30 +1495,11 @@ opt_crl(UserOpts, Opts, _Env) ->
14951495opt_handshake (UserOpts , Opts , _Env ) ->
14961496 {_ , HS } = get_opt_of (handshake , [hello , full ], full , UserOpts , Opts ),
14971497
1498- DefaultMaxHS = default_max_hs (Opts ),
1499-
1500- {_ , MHSS } = get_opt_int (max_handshake_size , 1 , ? MAX_UNIT24 , DefaultMaxHS ,
1498+ {_ , MHSS } = get_opt_int (max_handshake_size , 1 , ? MAX_UNIT24 , ? DEFAULT_MAX_HANDSHAKE_SIZE ,
15011499 UserOpts , Opts ),
15021500
15031501 Opts #{handshake => HS , max_handshake_size => MHSS }.
15041502
1505- default_max_hs (#{signature_algs := undefined }) ->
1506- ? DEFAULT_MAX_HANDSHAKE_SIZE ;
1507- default_max_hs (#{signature_algs := Algs }) ->
1508- % %% In OTP-26 max handshake_size was lowered by half for most
1509- % %% handshakes would fit that size and OpenSSL had a lower default
1510- Set = sets :intersection (sets :from_list (Algs , [{version , 2 }]),
1511- sets :from_list (tls_v1 :slh_dsa_schemes (),
1512- [{version , 2 }])),
1513- case sets :is_empty (Set ) of
1514- true ->
1515- ? DEFAULT_MAX_HANDSHAKE_SIZE ;
1516- false ->
1517- % % SLH_DSA creates fairly big handshake sizes so raise limit back
1518- % % if these algorithms are supported,
1519- ? DEFAULT_MAX_HANDSHAKE_SIZE * 2
1520- end .
1521-
15221503opt_use_srtp (UserOpts , #{protocol := Protocol } = Opts , _Env ) ->
15231504 UseSRTP = case get_opt_map (use_srtp , undefined , UserOpts , Opts ) of
15241505 {old , UseSRTP0 } ->
0 commit comments