diff options
author | Ingela Anderton Andin <[email protected]> | 2011-12-05 10:59:54 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2011-12-05 10:59:54 +0100 |
commit | dc8684a7da4604f85784b581c0b1d6841acae6fa (patch) | |
tree | 890a6fea1356be4025eceeea78bac4dfd1cf8260 /lib/ssl/src | |
parent | 3e64ea48156c1aabd75bc985941a709bafca54cd (diff) | |
parent | f1f1d43cf7766fed73d1b52a4f18bc0367ccbd1a (diff) | |
download | otp-dc8684a7da4604f85784b581c0b1d6841acae6fa.tar.gz otp-dc8684a7da4604f85784b581c0b1d6841acae6fa.tar.bz2 otp-dc8684a7da4604f85784b581c0b1d6841acae6fa.zip |
Merge branch 'ia/ssl/rc4-no-split'
* ia/ssl/rc4-no-split:
Do not do the 1/n-1 split for RC4 as it is not vulnerable to the Rizzo/Duong-Beast attack.
Diffstat (limited to 'lib/ssl/src')
-rw-r--r-- | lib/ssl/src/ssl_record.erl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl index f52d2f961c..830026c825 100644 --- a/lib/ssl/src/ssl_record.erl +++ b/lib/ssl/src/ssl_record.erl @@ -508,8 +508,12 @@ decode_cipher_text(CipherText, ConnnectionStates0) -> %% %% Description: Encodes data to send on the ssl-socket. %%-------------------------------------------------------------------- -encode_data(Frag, Version, ConnectionStates) -> - Data = split_bin(Frag, ?MAX_PLAIN_TEXT_LENGTH, Version), +encode_data(Frag, Version, + #connection_states{current_write = #connection_state{ + security_parameters = + #security_parameters{bulk_cipher_algorithm = BCA}}} = + ConnectionStates) -> + Data = split_bin(Frag, ?MAX_PLAIN_TEXT_LENGTH, Version, BCA), encode_iolist(?APPLICATION_DATA, Data, Version, ConnectionStates). %%-------------------------------------------------------------------- @@ -588,11 +592,11 @@ record_protocol_role(client) -> record_protocol_role(server) -> ?SERVER. -%% 1/n-1 splitting countermeasure Rizzo/Duong-Beast -split_bin(<<FirstByte:8, Rest/binary>>, ChunkSize, Version) when {3, 1} == Version orelse - {3, 0} == Version -> +%% 1/n-1 splitting countermeasure Rizzo/Duong-Beast, RC4 chiphers are not vulnerable to this attack. +split_bin(<<FirstByte:8, Rest/binary>>, ChunkSize, Version, BCA) when BCA =/= ?RC4 andalso ({3, 1} == Version orelse + {3, 0} == Version) -> do_split_bin(Rest, ChunkSize, [[FirstByte]]); -split_bin(Bin, ChunkSize, _) -> +split_bin(Bin, ChunkSize, _, _) -> do_split_bin(Bin, ChunkSize, []). do_split_bin(<<>>, _, Acc) -> |