FIX: flatten boost buffer sequence for TLS#3839
Merged
reneme merged 1 commit intorandombit:masterfrom Dec 21, 2023
Merged
Conversation
FAlbertDev
approved these changes
Dec 15, 2023
randombit
approved these changes
Dec 21, 2023
Owner
randombit
left a comment
There was a problem hiding this comment.
Oof, yeah it would be good to provide something to help with this in the base TLS channel interface.
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adapts the ASIO Stream wrapper to flatten incoming buffer sequences (if needed) into a single buffer. Before, we simply iterated the buffer sequence and called
TLS::Channel::send()for each buffer. Though, that can be sub optimal, because it may create many tiny TLS records.For instance, Boost Beast renders its HTTP response into many small buffers that may contain just a single line of HTTP headers or perhaps even less. As a result,
./botan tls_http_servergenerated several tiny TLS records to transfer the HTTP response. It turns out thattlsfuzzerchokes on this, as it expects the HTTP response to be shipped in a single TLS record.It goes without saying that this data copy isn't optimal either. At one point we should look into extending
TLS::Channelto be able to deal with scattered data buffers.