Skip to content

Commit

Permalink
ssl: Fix Curve selection
Browse files Browse the repository at this point in the history
  • Loading branch information
IngelaAndin committed May 8, 2013
1 parent badb8f1 commit 50a75c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ssl/src/ssl_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ hello(Hello = #client_hello{client_version = ClientVersion},
EcPointFormats, EllipticCurves,
State#state{connection_states = ConnectionStates,
negotiated_version = Version,
session = Session});
session = Session,
client_ecc = {EllipticCurves, EcPointFormats}});
#alert{} = Alert ->
handle_own_alert(Alert, ClientVersion, hello, State)
end;
Expand Down Expand Up @@ -3079,6 +3080,7 @@ handle_close_alert(Data, StateName, State0) ->
ok
end.

select_curve(#state{client_ecc = {[Curve|_], _}}) ->
{namedCurve, Curve};
select_curve(_) ->
%%TODO: select prefered curve from extension
{namedCurve, ?secp256k1}.

0 comments on commit 50a75c5

Please sign in to comment.