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

Introduce async callbacks #134

Merged
merged 12 commits into from
Oct 10, 2023
Merged

Introduce async callbacks #134

merged 12 commits into from
Oct 10, 2023

Conversation

nox
Copy link
Collaborator

@nox nox commented Jul 31, 2023

No description provided.

boring/src/ssl/connector.rs Outdated Show resolved Hide resolved
boring/src/ssl/connector.rs Outdated Show resolved Hide resolved
boring/src/ssl/mod.rs Show resolved Hide resolved
boring/src/ssl/mod.rs Show resolved Hide resolved
tokio-boring/src/async_callbacks.rs Outdated Show resolved Hide resolved
tokio-boring/src/async_callbacks.rs Show resolved Hide resolved
tokio-boring/src/lib.rs Outdated Show resolved Hide resolved
tokio-boring/src/lib.rs Outdated Show resolved Hide resolved
tokio-boring/src/lib.rs Outdated Show resolved Hide resolved
tokio-boring/src/lib.rs Outdated Show resolved Hide resolved
@nox

This comment was marked as outdated.

@nox nox force-pushed the async branch 4 times, most recently from 3691580 to 8c6fd07 Compare August 1, 2023 14:34
@nox nox force-pushed the async branch 8 times, most recently from 31af102 to 71dad44 Compare August 4, 2023 08:32
@nox

This comment was marked as outdated.

@nox nox force-pushed the async branch 6 times, most recently from 2694e68 to e5bb7c6 Compare August 4, 2023 14:35
@nox
Copy link
Collaborator Author

nox commented Aug 4, 2023

I removed the biggest breaking change (the removal of accept and connect).

@nox nox force-pushed the async branch 2 times, most recently from ed4142d to abf3ec4 Compare August 4, 2023 16:01
@nox nox marked this pull request as ready for review August 4, 2023 16:02
@nox
Copy link
Collaborator Author

nox commented Aug 4, 2023

The one missing thing from the PR is tests for PrivateKeyMethod::decrypt but I don't understand the circumstances that make boringssl invoke it.

@nox nox changed the title Introduce async callbacks for set_select_certificate_callback Introduce async callbacks Aug 4, 2023
Copy link

@Noah-Kennedy Noah-Kennedy left a comment

Choose a reason for hiding this comment

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

I'm a bit nervous about a few things I see, and I'd like to go over this more thoroughly tomorrow or Monday.

boring/src/ssl/callbacks.rs Show resolved Hide resolved
boring/src/ssl/mod.rs Show resolved Hide resolved
boring/src/ssl/mod.rs Show resolved Hide resolved
tokio-boring/src/bridge.rs Outdated Show resolved Hide resolved
boring/src/ssl/mod.rs Outdated Show resolved Hide resolved
boring/src/ssl/test/mod.rs Show resolved Hide resolved
boring/src/ssl/mod.rs Outdated Show resolved Hide resolved
ghedo and others added 12 commits October 9, 2023 12:55
These lists are hardcoded and the calls have no business failing in the first place.
These two new kinds of methods immediately return a MidHandshakeSslStream
instead of actually initiating a handshake. This greatly simplifies
loops around MidHandshakeSslStream::WouldBlock.
This encapsulates a bit better the unsafety of task context
management to invoke async code from inside boring.
To handle lifetimes better and allow returning a &mut SslRef from
the client hello struct passed to the closure from
SslContextBuilder::set_select_certificate_callback, we make
the ClientHello struct itself own a reference to the FFI
client hello struct.
We introduce tokio_boring::SslContextBuilderExt, with 2 methods:

* set_async_select_certificate_callback
* set_async_private_key_method
@ghedo ghedo merged commit ea96015 into cloudflare:master Oct 10, 2023
21 checks passed
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.

5 participants