Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public TLS API uses std::span #3363

Merged
merged 5 commits into from
Mar 14, 2023
Merged

Public TLS API uses std::span #3363

merged 5 commits into from
Mar 14, 2023

Conversation

reneme
Copy link
Collaborator

@reneme reneme commented Mar 13, 2023

This adds overloads for std::span<> to the TLS channel API: Namely TLS::Channel::received_data() and ::send(). Internally, those are now dispatched to the new (virtual) protected methods ::from_peer() and ::to_peer(). Subclasses of the basic TLS channel now overload those. The ptr-length style overloads of ::received_data() and ::send() are left intact.

The TLS::Callbacks::tls_emit_data() and TLS::Callbacks::tls_record_received() now use std::span<> as well. This is not backward compatible, unfortunately. The migration guide has been adapted accordingly.

Also, the TLS 1.3 implementation is adapted slightly to push the std::span<> deeper into layers. More adaptions are left for future work.

@reneme reneme added this to the Botan 3.0.0 milestone Mar 13, 2023
Copy link
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.

Especially with the callback changes, if we are ever going to do it now is the time. Thanks for your efforts on this.

@reneme reneme merged commit c6e9f13 into master Mar 14, 2023
@randombit randombit deleted the tls13/span branch March 14, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants