mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibTLS: Count the mac size towards the packet length in CBC mode
This is a regression introduced in 1172746
, where the padding would be
done without accounting for the added MAC bytes.
Fixes #4098.
This commit is contained in:
parent
2a06b026ef
commit
de4061ff94
Notes:
sideshowbarker
2024-07-19 01:22:20 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/de4061ff945 Pull-request: https://github.com/SerenityOS/serenity/pull/4099 Issue: https://github.com/SerenityOS/serenity/issues/4098
1 changed files with 2 additions and 2 deletions
|
@ -77,10 +77,10 @@ void TLSv12::update_packet(ByteBuffer& packet)
|
|||
// If the length is already a multiple a block_size,
|
||||
// an entire block of padding is added.
|
||||
// In short, we _never_ have no padding.
|
||||
padding = block_size - length % block_size;
|
||||
length += padding;
|
||||
mac_size = mac_length();
|
||||
length += mac_size;
|
||||
padding = block_size - length % block_size;
|
||||
length += padding;
|
||||
} else {
|
||||
block_size = m_aes_local.gcm->cipher().block_size();
|
||||
padding = 0;
|
||||
|
|
Loading…
Reference in a new issue