diff --git a/src/mtp_fake_tls.erl b/src/mtp_fake_tls.erl index a0a20a4..135ccf5 100644 --- a/src/mtp_fake_tls.erl +++ b/src/mtp_fake_tls.erl @@ -21,6 +21,7 @@ -ifdef(TEST). -export([make_client_hello/2, make_client_hello/4, + make_dummy_change_cipher/0, parse_server_hello/1]). -endif. @@ -295,6 +296,13 @@ add_padding_ext(RealExtensions, ExtLen) -> (binary:copy(<<0>>, PadSize))/binary>>, <>. +%% https://tools.ietf.org/html/rfc8446#appendix-D.4 +make_dummy_change_cipher() -> + <>. + %% Parses "ServerHello" (the one produced by from_client_hello/2). Used for tests only. parse_server_hello(< ok = gen_tcp:send(Sock, ClientHello), %% Let's hope whole server hello will arrive in a single chunk Tail_ = recv_server_hello(Sock, Timeout, <<>>), + ok = gen_tcp:send(Sock, mtp_fake_tls:make_dummy_change_cipher()), {mtp_secure, true, mtp_fake_tls:new(), Tail_}; _ -> {Protocol0, false, undefined, <<>>} end,