aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_handshake.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2011-09-28 09:10:44 +0200
committerIngela Anderton Andin <[email protected]>2011-09-28 09:10:44 +0200
commit7d936aabd1573c0a7d3bd5bc94e4996e60ba2f72 (patch)
treeaca789f0ee526c3fc9038f558990d67f56db64cf /lib/ssl/src/ssl_handshake.erl
parentb6a3b89471bf1e19f604e11e3405d593cf7591cd (diff)
parent9b7b4db9d7e5734f6c5c2193786c44cf1e273efb (diff)
downloadotp-7d936aabd1573c0a7d3bd5bc94e4996e60ba2f72.tar.gz
otp-7d936aabd1573c0a7d3bd5bc94e4996e60ba2f72.tar.bz2
otp-7d936aabd1573c0a7d3bd5bc94e4996e60ba2f72.zip
Merge branch 'fix_unknown_ssl_extension_parsing' into dev
* fix_unknown_ssl_extension_parsing: Both the SSLv3 and TLS 1.0/TLS 1.1 specifications require implementations to ignore data following the ClientHello (i.e., extensions) if they do not understand them. fix unknown ssl extension parsing by changing length from bits to bytes
Diffstat (limited to 'lib/ssl/src/ssl_handshake.erl')
-rw-r--r--lib/ssl/src/ssl_handshake.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl
index 453ea20f99..f873a6a913 100644
--- a/lib/ssl/src/ssl_handshake.erl
+++ b/lib/ssl/src/ssl_handshake.erl
@@ -39,6 +39,8 @@
encode_handshake/2, init_hashes/0, update_hashes/2,
decrypt_premaster_secret/2]).
+-export([dec_hello_extensions/2]).
+
-type tls_handshake() :: #client_hello{} | #server_hello{} |
#server_hello_done{} | #certificate{} | #certificate_request{} |
#client_key_exchange{} | #finished{} | #certificate_verify{} |
@@ -912,9 +914,12 @@ dec_hello_extensions(<<?UINT16(?RENEGOTIATION_EXT), ?UINT16(Len), Info:Len/binar
end,
dec_hello_extensions(Rest, [{renegotiation_info,
#renegotiation_info{renegotiated_connection = RenegotiateInfo}} | Acc]);
-dec_hello_extensions(<<?UINT16(_), ?UINT16(Len), _Unknown:Len, Rest/binary>>, Acc) ->
+
+%% Ignore data following the ClientHello (i.e.,
+%% extensions) if not understood.
+dec_hello_extensions(<<?UINT16(_), ?UINT16(Len), _Unknown:Len/binary, Rest/binary>>, Acc) ->
dec_hello_extensions(Rest, Acc);
-%% Need this clause?
+%% This theoretically should not happen if the protocol is followed, but if it does it is ignored.
dec_hello_extensions(_, Acc) ->
Acc.