aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_connection.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2016-09-28 10:21:06 +0200
committerErlang/OTP <[email protected]>2016-09-28 10:21:06 +0200
commit83281b7c911abc34ba6359e88be39bada31073d8 (patch)
tree05462266b7e6151ec01ecf69b6a7ec771514d267 /lib/ssl/src/ssl_connection.erl
parentda8463b33de0201cea756e0690248f2185f1cccb (diff)
parentca78bf1500c5f3c68d72214bd06fcc1b66a52c38 (diff)
downloadotp-83281b7c911abc34ba6359e88be39bada31073d8.tar.gz
otp-83281b7c911abc34ba6359e88be39bada31073d8.tar.bz2
otp-83281b7c911abc34ba6359e88be39bada31073d8.zip
Merge branch 'ingela/ssl/ECC-selection-fix/OTP-13918' into maint-19
* ingela/ssl/ECC-selection-fix/OTP-13918: ssl: Correct ECC curve selection, the error could cause default to always be selected.
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r--lib/ssl/src/ssl_connection.erl8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 304d1706f5..08fca76123 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -1430,13 +1430,14 @@ key_exchange(#state{role = server, private_key = Key, key_algorithm = Algo} = St
key_exchange(#state{role = server, key_algorithm = Algo,
hashsign_algorithm = HashSignAlgo,
private_key = PrivateKey,
+ session = #session{ecc = ECCCurve},
connection_states = ConnectionStates0,
negotiated_version = Version
} = State0, Connection)
when Algo == ecdhe_ecdsa; Algo == ecdhe_rsa;
Algo == ecdh_anon ->
- ECDHKeys = public_key:generate_key(select_curve(State0)),
+ ECDHKeys = public_key:generate_key(ECCCurve),
#{security_parameters := SecParams} =
ssl_record:pending_connection_state(ConnectionStates0, read),
#security_parameters{client_random = ClientRandom,
@@ -1845,11 +1846,6 @@ cipher_role(server, Data, Session, #state{connection_states = ConnectionStates0
{Record, State} = prepare_connection(State1, Connection),
Connection:next_event(connection, Record, State).
-select_curve(#state{client_ecc = {[Curve|_], _}}) ->
- {namedCurve, Curve};
-select_curve(_) ->
- {namedCurve, ?secp256r1}.
-
is_anonymous(Algo) when Algo == dh_anon;
Algo == ecdh_anon;
Algo == psk;