aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_connection.hrl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-09-17 15:28:20 +0200
committerIngela Anderton Andin <[email protected]>2013-12-02 09:44:49 +0100
commitb3d5f82bd3baf5b63ea97c017cb83674ca703c66 (patch)
tree9e69018308dd59d9224129fe81e718fdeb78e341 /lib/ssl/src/ssl_connection.hrl
parent810c34a7991f2b6edd5e9f41e3c667958a5b2bc8 (diff)
downloadotp-b3d5f82bd3baf5b63ea97c017cb83674ca703c66.tar.gz
otp-b3d5f82bd3baf5b63ea97c017cb83674ca703c66.tar.bz2
otp-b3d5f82bd3baf5b63ea97c017cb83674ca703c66.zip
ssl: Refactor connection and handshake handling
Diffstat (limited to 'lib/ssl/src/ssl_connection.hrl')
-rw-r--r--lib/ssl/src/ssl_connection.hrl81
1 files changed, 81 insertions, 0 deletions
diff --git a/lib/ssl/src/ssl_connection.hrl b/lib/ssl/src/ssl_connection.hrl
new file mode 100644
index 0000000000..92134dfeb3
--- /dev/null
+++ b/lib/ssl/src/ssl_connection.hrl
@@ -0,0 +1,81 @@
+
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2013-2013. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+%%----------------------------------------------------------------------
+%% Purpose: SSL/TLS specific state
+%%----------------------------------------------------------------------
+
+-ifndef(ssl_connection).
+-define(ssl_connection, true).
+
+-record(state, {
+ role :: client | server,
+ user_application :: {Monitor::reference(), User::pid()},
+ transport_cb :: atom(), % callback module
+ data_tag :: atom(), % ex tcp.
+ close_tag :: atom(), % ex tcp_closed
+ error_tag :: atom(), % ex tcp_error
+ host, % string() | ipadress()
+ port :: integer(),
+ socket, % socket()
+ ssl_options, % #ssl_options{}
+ socket_options, % #socket_options{}
+ connection_states, % #connection_states{} from ssl_record.hrl
+ protocol_buffers,
+ tls_handshake_history, % tls_handshake_history()
+ cert_db, %
+ session, % #session{} from tls_handshake.hrl
+ session_cache, %
+ session_cache_cb, %
+ negotiated_version, % tls_version()
+ client_certificate_requested = false,
+ key_algorithm, % atom as defined by cipher_suite
+ hashsign_algorithm = {undefined, undefined},
+ cert_hashsign_algorithm,
+ public_key_info, % PKIX: {Algorithm, PublicKey, PublicKeyParams}
+ private_key, % PKIX: #'RSAPrivateKey'{}
+ diffie_hellman_params, % PKIX: #'DHParameter'{} relevant for server side
+ diffie_hellman_keys, % {PublicKey, PrivateKey}
+ psk_identity, % binary() - server psk identity hint
+ srp_params, % #srp_user{}
+ srp_keys, % {PublicKey, PrivateKey}
+ premaster_secret, %
+ file_ref_db, % ets()
+ cert_db_ref, % ref()
+ bytes_to_read, % integer(), # bytes to read in passive mode
+ user_data_buffer, % binary()
+ renegotiation, % {boolean(), From | internal | peer}
+ start_or_recv_from, % "gen_fsm From"
+ timer, % start_or_recv_timer
+ send_queue, % queue()
+ terminated = false ::boolean(),
+ allow_renegotiate = true ::boolean(),
+ expecting_next_protocol_negotiation = false :: boolean(),
+ next_protocol = undefined :: undefined | binary(),
+ client_ecc % {Curves, PointFmt}
+ }).
+
+-define(DEFAULT_DIFFIE_HELLMAN_PARAMS,
+ #'DHParameter'{prime = ?DEFAULT_DIFFIE_HELLMAN_PRIME,
+ base = ?DEFAULT_DIFFIE_HELLMAN_GENERATOR}).
+-define(WAIT_TO_ALLOW_RENEGOTIATION, 12000).
+
+-endif. % -ifdef(ssl_connection).