diff options
author | Andreas Schultz <[email protected]> | 2016-05-04 10:11:17 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2016-06-13 22:24:14 +0200 |
commit | 54b59a6270355787700d06de619735a4c4240608 (patch) | |
tree | d348a1b21d53df5e42dd5c18f47f1a9fe8e44199 /lib/ssl/src | |
parent | 549a92ed4980f1e87756edea55354de4c9b10856 (diff) | |
download | otp-54b59a6270355787700d06de619735a4c4240608.tar.gz otp-54b59a6270355787700d06de619735a4c4240608.tar.bz2 otp-54b59a6270355787700d06de619735a4c4240608.zip |
dtls: implement next_tls_record
Conflicts:
lib/ssl/src/dtls_connection.erl
Diffstat (limited to 'lib/ssl/src')
-rw-r--r-- | lib/ssl/src/dtls_connection.erl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl index cb5db3f4c3..014e915e12 100644 --- a/lib/ssl/src/dtls_connection.erl +++ b/lib/ssl/src/dtls_connection.erl @@ -409,10 +409,19 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions}, User, protocol_cb = ?MODULE }. -next_tls_record(<<>>, _State) -> - #alert{}; %% Place holder -next_tls_record(_, State) -> - {#ssl_tls{fragment = <<"place holder">>}, State}. +next_tls_record(Data, #state{protocol_buffers = #protocol_buffers{ + dtls_record_buffer = Buf0, + dtls_cipher_texts = CT0} = Buffers} = State0) -> + case dtls_record:get_dtls_records(Data, Buf0) of + {Records, Buf1} -> + CT1 = CT0 ++ Records, + next_record(State0#state{protocol_buffers = + Buffers#protocol_buffers{dtls_record_buffer = Buf1, + dtls_cipher_texts = CT1}}); + + #alert{} = Alert -> + Alert + end. next_record(#state{%%flight = #flight{state = finished}, protocol_buffers = |