aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_cipher.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-12-14 09:48:38 +0100
committerIngela Anderton Andin <[email protected]>2018-12-14 09:48:38 +0100
commita2cdf319505b102c0b8bb192d36a08448d304559 (patch)
tree2a4da39871781bd69bce461141aacfa9b7d5ef8b /lib/ssl/src/ssl_cipher.erl
parentf191f67b98c3efeef08045b212472ed9af1f0d7b (diff)
parent28dcf6d400cea06e4bc8ca1d4224aae009ef232e (diff)
downloadotp-a2cdf319505b102c0b8bb192d36a08448d304559.tar.gz
otp-a2cdf319505b102c0b8bb192d36a08448d304559.tar.bz2
otp-a2cdf319505b102c0b8bb192d36a08448d304559.zip
Merge branch 'ingela/ssl/optimize/OTP-15445' into maint
* ingela/ssl/optimize/OTP-15445: ssl: Fix test case ssl: Remove no longer needed functions ssl: Fix downgrade ssl: Remove checks and conversions not needed ssl: Use binary:copy/2 to avoid list overhead ssl: Remove unnecessary internal event ssl: Clean code ssl: Add static_env record
Diffstat (limited to 'lib/ssl/src/ssl_cipher.erl')
-rw-r--r--lib/ssl/src/ssl_cipher.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl
index 54c04c13e5..66a00c60f1 100644
--- a/lib/ssl/src/ssl_cipher.erl
+++ b/lib/ssl/src/ssl_cipher.erl
@@ -889,7 +889,7 @@ is_correct_padding(GenBlockCipher, {3, 1}, false) ->
is_correct_padding(#generic_block_cipher{padding_length = Len,
padding = Padding}, _, _) ->
Len == byte_size(Padding) andalso
- list_to_binary(lists:duplicate(Len, Len)) == Padding.
+ binary:copy(?byte(Len), Len) == Padding.
get_padding(Length, BlockSize) ->
get_padding_aux(BlockSize, Length rem BlockSize).
@@ -898,7 +898,7 @@ get_padding_aux(_, 0) ->
{0, <<>>};
get_padding_aux(BlockSize, PadLength) ->
N = BlockSize - PadLength,
- {N, list_to_binary(lists:duplicate(N, N))}.
+ {N, binary:copy(?byte(N), N)}.
random_iv(IV) ->
IVSz = byte_size(IV),