diff options
author | Ingela Anderton Andin <[email protected]> | 2013-04-23 15:58:36 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-05-08 10:39:19 +0200 |
commit | d9d8d008728b4522c62ed90540b1d90097fddb68 (patch) | |
tree | d01619c5e1d1ebdf2c99a4c60ce5540ccccd7f65 /lib/ssl/src/ssl_connection.erl | |
parent | 3155ca5b47149a214b101f6c0b84cdcd0400a30b (diff) | |
download | otp-d9d8d008728b4522c62ed90540b1d90097fddb68.tar.gz otp-d9d8d008728b4522c62ed90540b1d90097fddb68.tar.bz2 otp-d9d8d008728b4522c62ed90540b1d90097fddb68.zip |
ssl: Remove dependency on internal public_key function
Avoid unneccessary conversion as the input format is an oid (according
to ASN1 spec) we do not need to handle it as an atom in ssl.
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r-- | lib/ssl/src/ssl_connection.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 4d64cd8523..2a32bdf066 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -1647,7 +1647,7 @@ key_exchange(#state{role = server, key_algorithm = Algo, when Algo == ecdhe_ecdsa; Algo == ecdhe_rsa; Algo == ecdh_anon -> - ECDHKeys = public_key:generate_key({curve, default_curve(State)}), + ECDHKeys = public_key:generate_key(select_curve(State)), ConnectionState = ssl_record:pending_connection_state(ConnectionStates0, read), SecParams = ConnectionState#connection_state.security_parameters, @@ -2050,7 +2050,7 @@ server_master_secret(#server_dh_params{dh_p = P, dh_g = G, dh_y = ServerPublicDh server_master_secret(#server_ecdh_params{curve = ECCurve, public = ECServerPubKey}, State) -> - ECDHKeys = public_key:generate_key({curve, ECCurve}), + ECDHKeys = public_key:generate_key(ECCurve), ec_dh_master_secret(ECDHKeys, #'ECPoint'{point = ECServerPubKey}, State#state{diffie_hellman_keys = ECDHKeys}); server_master_secret(#server_psk_params{ @@ -3084,6 +3084,6 @@ handle_close_alert(Data, StateName, State0) -> ok end. -default_curve(_) -> +select_curve(_) -> %%TODO: select prefered curve from extension - secp256k1. + {namedCurve, ?secp256k1}. |