aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2014-01-28 16:30:04 +0100
committerIngela Anderton Andin <[email protected]>2014-01-28 16:30:04 +0100
commitaaedd450662a68e40b6c45e70024464e3f5dbcdf (patch)
treee70d8d1b285f794a2494ae1451020c6bc9fc8cf7 /lib/ssl
parentd70ca477dcc38dc1738e4c55a01e947d9b3e71c9 (diff)
parent175eda89c619cca9975c181c0b1cc4f07c93bb6a (diff)
downloadotp-aaedd450662a68e40b6c45e70024464e3f5dbcdf.tar.gz
otp-aaedd450662a68e40b6c45e70024464e3f5dbcdf.tar.bz2
otp-aaedd450662a68e40b6c45e70024464e3f5dbcdf.zip
Merge branch 'ia/RoadRunner/tls-validate-options/OTP-11634'
* ia/RoadRunner/tls-validate-options/OTP-11634: ssl: use is_boolean/1 guard in option validation
Diffstat (limited to 'lib/ssl')
-rw-r--r--lib/ssl/src/ssl.erl18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 4646468cb6..8c2b84bc1e 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -697,11 +697,9 @@ validate_option(verify_fun, Fun) when is_function(Fun) ->
end, Fun};
validate_option(verify_fun, {Fun, _} = Value) when is_function(Fun) ->
Value;
-validate_option(fail_if_no_peer_cert, Value)
- when Value == true; Value == false ->
+validate_option(fail_if_no_peer_cert, Value) when is_boolean(Value) ->
Value;
-validate_option(verify_client_once, Value)
- when Value == true; Value == false ->
+validate_option(verify_client_once, Value) when is_boolean(Value) ->
Value;
validate_option(depth, Value) when is_integer(Value),
Value >= 0, Value =< 255->
@@ -781,12 +779,10 @@ validate_option(ciphers, Value) when is_list(Value) ->
end;
validate_option(reuse_session, Value) when is_function(Value) ->
Value;
-validate_option(reuse_sessions, Value) when Value == true;
- Value == false ->
+validate_option(reuse_sessions, Value) when is_boolean(Value) ->
Value;
-validate_option(secure_renegotiate, Value) when Value == true;
- Value == false ->
+validate_option(secure_renegotiate, Value) when is_boolean(Value) ->
Value;
validate_option(renegotiate_at, Value) when is_integer(Value) ->
erlang:min(Value, ?DEFAULT_RENEGOTIATE_AT);
@@ -795,8 +791,7 @@ validate_option(hibernate_after, undefined) ->
undefined;
validate_option(hibernate_after, Value) when is_integer(Value), Value >= 0 ->
Value;
-validate_option(erl_dist,Value) when Value == true;
- Value == false ->
+validate_option(erl_dist,Value) when is_boolean(Value) ->
Value;
validate_option(client_preferred_next_protocols = Opt, {Precedence, PreferredProtocols} = Value)
when is_list(PreferredProtocols) ->
@@ -822,8 +817,7 @@ validate_option(client_preferred_next_protocols = Opt, {Precedence, PreferredPro
validate_option(client_preferred_next_protocols, undefined) ->
undefined;
-validate_option(log_alert, Value) when Value == true;
- Value == false ->
+validate_option(log_alert, Value) when is_boolean(Value) ->
Value;
validate_option(next_protocols_advertised = Opt, Value) when is_list(Value) ->
case tls_record:highest_protocol_version([]) of