aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test/ssl_handshake_SUITE.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-11-11 10:05:31 +0100
committerFredrik Gustafsson <[email protected]>2013-11-11 10:05:31 +0100
commit264a12e19030f8861bf909b79479b2c0b7bd1ee0 (patch)
treedc67c00f57479ba0065f5e43cd2a4265ccd58867 /lib/ssl/test/ssl_handshake_SUITE.erl
parente07a7499a54fe9001b7bdc9544199bec30818e98 (diff)
parenta2d97b6405066c702678e891d0d3c7640b81d621 (diff)
downloadotp-264a12e19030f8861bf909b79479b2c0b7bd1ee0.tar.gz
otp-264a12e19030f8861bf909b79479b2c0b7bd1ee0.tar.bz2
otp-264a12e19030f8861bf909b79479b2c0b7bd1ee0.zip
Merge branch 'maint'
Diffstat (limited to 'lib/ssl/test/ssl_handshake_SUITE.erl')
-rw-r--r--lib/ssl/test/ssl_handshake_SUITE.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ssl/test/ssl_handshake_SUITE.erl b/lib/ssl/test/ssl_handshake_SUITE.erl
index 9695710230..7e8e8d2611 100644
--- a/lib/ssl/test/ssl_handshake_SUITE.erl
+++ b/lib/ssl/test/ssl_handshake_SUITE.erl
@@ -34,7 +34,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() -> [decode_hello_handshake,
decode_single_hello_extension_correctly,
- decode_unknown_hello_extension_correctly].
+ decode_unknown_hello_extension_correctly,
+ encode_single_hello_sni_extension_correctly].
%%--------------------------------------------------------------------
%% Test Cases --------------------------------------------------------
@@ -73,3 +74,12 @@ decode_unknown_hello_extension_correctly(_Config) ->
Extensions = ssl_handshake:decode_hello_extensions(<<FourByteUnknown/binary, Renegotiation/binary>>),
#renegotiation_info{renegotiated_connection = <<0>>}
= Extensions#hello_extensions.renegotiation_info.
+
+encode_single_hello_sni_extension_correctly(_Config) ->
+ Exts = #hello_extensions{sni = #sni{hostname = "test.com"}},
+ SNI = <<16#00, 16#00, 16#00, 16#0d, 16#00, 16#0b, 16#00, 16#00, 16#08,
+ $t, $e, $s, $t, $., $c, $o, $m>>,
+ ExtSize = byte_size(SNI),
+ HelloExt = <<ExtSize:16/unsigned-big-integer, SNI/binary>>,
+ Encoded = ssl_handshake:encode_hello_extensions(Exts),
+ HelloExt = Encoded.