Skip to content

FIX: flatten boost buffer sequence for TLS#3839

Merged
reneme merged 1 commit intorandombit:masterfrom
Rohde-Schwarz:fix/asio_buffer_sequence_handling
Dec 21, 2023
Merged

FIX: flatten boost buffer sequence for TLS#3839
reneme merged 1 commit intorandombit:masterfrom
Rohde-Schwarz:fix/asio_buffer_sequence_handling

Conversation

@reneme
Copy link
Copy Markdown
Collaborator

@reneme reneme commented Dec 14, 2023

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_server generated several tiny TLS records to transfer the HTTP response. It turns out that tlsfuzzer chokes 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::Channel to be able to deal with scattered data buffers.

@reneme reneme added the enhancement Enhancement or new feature label Dec 14, 2023
@reneme reneme requested a review from randombit December 14, 2023 12:25
@reneme reneme self-assigned this Dec 14, 2023
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 92.055% (-0.01%) from 92.068%
when pulling 715f695 on Rohde-Schwarz:fix/asio_buffer_sequence_handling
into 6641b5c on randombit:master.

@reneme reneme requested a review from lieser December 14, 2023 13:05
Copy link
Copy Markdown
Owner

@randombit randombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, yeah it would be good to provide something to help with this in the base TLS channel interface.

@reneme reneme mentioned this pull request Dec 21, 2023
14 tasks
@reneme reneme merged commit c59f1bd into randombit:master Dec 21, 2023
@reneme reneme deleted the fix/asio_buffer_sequence_handling branch December 21, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants