aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src
diff options
context:
space:
mode:
authorAndreas Schultz <[email protected]>2016-01-07 14:14:47 +0100
committerIngela Anderton Andin <[email protected]>2016-06-13 22:24:42 +0200
commit4c4bec1b8ba8bb8f9af0e8bb28725ade5e24adfe (patch)
tree7d365f4ce6f728417f8cdce03da1e7d2f33f860d /lib/ssl/src
parent0c38557bbee3f5cb288e8e1df9a77f2fbf1765d1 (diff)
downloadotp-4c4bec1b8ba8bb8f9af0e8bb28725ade5e24adfe.tar.gz
otp-4c4bec1b8ba8bb8f9af0e8bb28725ade5e24adfe.tar.bz2
otp-4c4bec1b8ba8bb8f9af0e8bb28725ade5e24adfe.zip
dtls: add implementation for msg sequence
Conflicts: lib/ssl/src/dtls_connection.erl lib/ssl/src/ssl_record.erl
Diffstat (limited to 'lib/ssl/src')
-rw-r--r--lib/ssl/src/dtls_connection.erl7
-rw-r--r--lib/ssl/src/ssl_record.erl3
-rw-r--r--lib/ssl/src/ssl_record.hrl2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl
index e4486d5b56..c5687ef58b 100644
--- a/lib/ssl/src/dtls_connection.erl
+++ b/lib/ssl/src/dtls_connection.erl
@@ -585,11 +585,6 @@ handle_own_alert(_,_,_, State) -> %% Place holder
handle_normal_shutdown(_, _, _State) -> %% Place holder
ok.
-
-sequence(_) ->
- %%TODO real imp
- 1.
-
handle_packet(Address, Port, Packet) ->
try dtls_record:get_dtls_records(Packet, <<>>) of
%% expect client hello
@@ -637,3 +632,5 @@ address_to_bin({A,B,C,D}, Port) ->
address_to_bin({A,B,C,D,E,F,G,H}, Port) ->
<<A:16,B:16,C:16,D:16,E:16,F:16,G:16,H:16,Port:16>>.
+sequence(#connection_states{dtls_write_msg_seq = Seq} = CS) ->
+ {Seq, CS#connection_states{dtls_write_msg_seq = Seq + 1}}.
diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl
index 2bd282c664..5bb1c92c2d 100644
--- a/lib/ssl/src/ssl_record.erl
+++ b/lib/ssl/src/ssl_record.erl
@@ -72,7 +72,8 @@ init_connection_states(Role, BeastMitigation) ->
ConnectionEnd = record_protocol_role(Role),
Current = initial_connection_state(ConnectionEnd, BeastMitigation),
Pending = empty_connection_state(ConnectionEnd, BeastMitigation),
- #connection_states{current_read = Current,
+ #connection_states{dtls_write_msg_seq = 1, % only used by dtls
+ current_read = Current,
pending_read = Pending,
current_write = Current,
pending_write = Pending
diff --git a/lib/ssl/src/ssl_record.hrl b/lib/ssl/src/ssl_record.hrl
index 87fde35258..a41264ff9b 100644
--- a/lib/ssl/src/ssl_record.hrl
+++ b/lib/ssl/src/ssl_record.hrl
@@ -46,6 +46,8 @@
}).
-record(connection_states, {
+ dtls_write_msg_seq, %% Only used by DTLS
+
current_read,
pending_read,
current_write,