aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/tls_handshake.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-09-05 09:38:55 +0200
committerIngela Anderton Andin <[email protected]>2018-09-05 09:38:55 +0200
commit092f4847f489cba0381676a6a389ddbfc2af4f1e (patch)
tree42afcebb40b3bdbc1718f532aa8c0ee83a182e4a /lib/ssl/src/tls_handshake.erl
parent1808df550501c5f834edf5d55d0bdcd2b4328d68 (diff)
parentf90d75a081f6d5a9a3cfe6f8d387abd7a1489aca (diff)
downloadotp-092f4847f489cba0381676a6a389ddbfc2af4f1e.tar.gz
otp-092f4847f489cba0381676a6a389ddbfc2af4f1e.tar.bz2
otp-092f4847f489cba0381676a6a389ddbfc2af4f1e.zip
Merge branch 'ingela/ssl/initial-tls-1.3-functions'
* ingela/ssl/initial-tls-1.3-functions: ssl: Initial cipher suites adoption for TLS-1.3 ssl: Add new TLS-1.3 Alerts ssl: Add initial TLS 1.3 hanshake encode/decode support
Diffstat (limited to 'lib/ssl/src/tls_handshake.erl')
-rw-r--r--lib/ssl/src/tls_handshake.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ssl/src/tls_handshake.erl b/lib/ssl/src/tls_handshake.erl
index 6812d3b42a..1fccc216cb 100644
--- a/lib/ssl/src/tls_handshake.erl
+++ b/lib/ssl/src/tls_handshake.erl
@@ -362,7 +362,7 @@ do_hello(Version, Versions, CipherSuites, Hello, SslOpts, Info, Renegotiation) -
%%--------------------------------------------------------------------
-enc_handshake(#hello_request{}, _Version) ->
+enc_handshake(#hello_request{}, {3, N}) when N < 4 ->
{?HELLO_REQUEST, <<>>};
enc_handshake(#client_hello{client_version = {Major, Minor},
random = Random,
@@ -381,7 +381,8 @@ enc_handshake(#client_hello{client_version = {Major, Minor},
?BYTE(SIDLength), SessionID/binary,
?UINT16(CsLength), BinCipherSuites/binary,
?BYTE(CmLength), BinCompMethods/binary, ExtensionsBin/binary>>};
-
+enc_handshake(HandshakeMsg, {3, 4}) ->
+ tls_handshake_1_3:encode_handshake(HandshakeMsg);
enc_handshake(HandshakeMsg, Version) ->
ssl_handshake:encode_handshake(HandshakeMsg, Version).
@@ -404,7 +405,7 @@ get_tls_handshake_aux(Version, <<?BYTE(Type), ?UINT24(Length),
get_tls_handshake_aux(_Version, Data, _, Acc) ->
{lists:reverse(Acc), Data}.
-decode_handshake(_, ?HELLO_REQUEST, <<>>) ->
+decode_handshake({3, N}, ?HELLO_REQUEST, <<>>) when N < 4 ->
#hello_request{};
decode_handshake(_Version, ?CLIENT_HELLO,
<<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
@@ -421,6 +422,8 @@ decode_handshake(_Version, ?CLIENT_HELLO,
compression_methods = Comp_methods,
extensions = DecodedExtensions
};
+decode_handshake({3, 4}, Tag, Msg) ->
+ tls_handshake_1_3:decode_handshake(Tag, Msg);
decode_handshake(Version, Tag, Msg) ->
ssl_handshake:decode_handshake(Version, Tag, Msg).