aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_handshake.erl
diff options
context:
space:
mode:
authorBen Murphy <[email protected]>2011-09-26 08:39:18 +0100
committerBen Murphy <[email protected]>2011-09-27 00:50:24 +0100
commit5f7725dc581c7891cb41e725db50076d654511ba (patch)
treeb87b8b3409f7af12432fd5a00dad6e71d9c36794 /lib/ssl/src/ssl_handshake.erl
parent53cf0b70c705e0bf6c09f83f2ce2709d79593ce6 (diff)
downloadotp-5f7725dc581c7891cb41e725db50076d654511ba.tar.gz
otp-5f7725dc581c7891cb41e725db50076d654511ba.tar.bz2
otp-5f7725dc581c7891cb41e725db50076d654511ba.zip
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.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl
index 453ea20f99..0ac1ba9d66 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,11 @@ 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) ->
+dec_hello_extensions(<<?UINT16(_), ?UINT16(Len), _Unknown:Len/binary, Rest/binary>>, Acc) ->
dec_hello_extensions(Rest, Acc);
%% Need this clause?
+%% I don't think we need this clause anymore. It was previously catching parsing errors caused by the missing /binary.
+%% Maybe we should be logging an error somewhere because we really should not be entering this clause.
dec_hello_extensions(_, Acc) ->
Acc.