aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/dtls_handshake.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-09-05 10:43:31 +0200
committerIngela Anderton Andin <[email protected]>2013-09-10 09:37:30 +0200
commit754b87eb181552d67c61c9a80c31ce52e4b39f19 (patch)
treef6f71c630e6cc22fa9e1c6615f43fc4f7dd5cfb0 /lib/ssl/src/dtls_handshake.erl
parentfa8b8cd60406ddcb2781f27e291949a8698c2886 (diff)
downloadotp-754b87eb181552d67c61c9a80c31ce52e4b39f19.tar.gz
otp-754b87eb181552d67c61c9a80c31ce52e4b39f19.tar.bz2
otp-754b87eb181552d67c61c9a80c31ce52e4b39f19.zip
ssl: Refactor TLS/DTLS record handling
Diffstat (limited to 'lib/ssl/src/dtls_handshake.erl')
-rw-r--r--lib/ssl/src/dtls_handshake.erl18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/ssl/src/dtls_handshake.erl b/lib/ssl/src/dtls_handshake.erl
index 8a481af76d..26e8ce7503 100644
--- a/lib/ssl/src/dtls_handshake.erl
+++ b/lib/ssl/src/dtls_handshake.erl
@@ -54,18 +54,18 @@ client_hello(Host, Port, Cookie, ConnectionStates,
#client_hello{session_id = Id,
client_version = Version,
cipher_suites = ssl_handshake:cipher_suites(CipherSuites, Renegotiation),
- compression_methods = tls_record:compressions(),
+ compression_methods = ssl_record:compressions(),
random = SecParams#security_parameters.client_random,
cookie = Cookie,
extensions = Extensions
}.
hello(Address, Port,
- #ssl_tls{epoch = Epoch, record_seq = Seq,
+ #ssl_tls{epoch = _Epoch, record_seq = _Seq,
version = Version} = Record) ->
{[{Hello, _}], _, _} =
- ssl_handshake:get_dtls_handshake(Record,
- ssl_handshake:dtls_handshake_new_flight(undefined)),
+ get_dtls_handshake(Record,
+ dtls_handshake_new_flight(undefined)),
#client_hello{client_version = {Major, Minor},
random = Random,
session_id = SessionId,
@@ -81,11 +81,9 @@ hello(Address, Port,
accept;
_ ->
%% generate HelloVerifyRequest
- {RequestFragment, _} = ssl_handshake:encode_handshake(
- ssl_handshake:hello_verify_request(Cookie),
- Version, 0, 1400),
- HelloVerifyRequest =
- ssl_record:encode_tls_cipher_text(?HANDSHAKE, Version, Epoch, Seq, RequestFragment),
+ HelloVerifyRequest = encode_handshake(#hello_verify_request{protocol_version = Version,
+ cookie = Cookie},
+ Version, 0, 1400),
{reply, HelloVerifyRequest}
end.
@@ -415,7 +413,7 @@ decode_handshake(_Version, ?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:3
random = Random,
session_id = Session_ID,
cookie = Cookie,
- cipher_suites = tls_handshake:decode_suites('2_bytes', CipherSuites),
+ cipher_suites = ssl_handshake:decode_suites('2_bytes', CipherSuites),
compression_methods = Comp_methods,
extensions = DecodedExtensions
};