Skip to content

Introduce async callbacks - #134

Merged
ghedo merged 12 commits into
cloudflare:masterfrom
nox:async
Oct 10, 2023
Merged

Introduce async callbacks#134
ghedo merged 12 commits into
cloudflare:masterfrom
nox:async

Conversation

@nox

@noxnox commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

No description provided.

Comment threadboring/src/ssl/connector.rs Outdated
Comment threadboring/src/ssl/connector.rs Outdated
Comment threadboring/src/ssl/mod.rs
Comment threadboring/src/ssl/mod.rs
Comment threadtokio-boring/src/async_callbacks.rs Outdated
Comment threadtokio-boring/src/async_callbacks.rs
Comment threadtokio-boring/src/lib.rs Outdated
Comment threadtokio-boring/src/lib.rs Outdated
Comment threadtokio-boring/src/lib.rs Outdated
Comment threadtokio-boring/src/lib.rs Outdated
@nox

This comment was marked as outdated.

@nox
noxforce-pushed the async branch 4 times, most recently from 3691580 to 8c6fd07CompareAugust 1, 2023 14:34
@noxnox mentioned this pull request Aug 1, 2023
@nox
noxforce-pushed the async branch 8 times, most recently from 31af102 to 71dad44CompareAugust 4, 2023 08:32
@nox

This comment was marked as outdated.

@nox
noxforce-pushed the async branch 6 times, most recently from 2694e68 to e5bb7c6CompareAugust 4, 2023 14:35
@nox

nox commented Aug 4, 2023

Copy link
Copy Markdown
ContributorAuthor

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

@nox
noxforce-pushed the async branch 2 times, most recently from ed4142d to abf3ec4CompareAugust 4, 2023 16:01
@nox
nox marked this pull request as ready for review August 4, 2023 16:02
@nox

nox commented Aug 4, 2023

Copy link
Copy Markdown
ContributorAuthor

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

@noxnox changed the title Introduce async callbacks for set_select_certificate_callbackIntroduce async callbacksAug 4, 2023

@Noah-KennedyNoah-Kennedy left a comment

Copy link
Copy Markdown

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.

Comment threadboring/src/ssl/callbacks.rs
Comment threadboring/src/ssl/mod.rs
Comment threadboring/src/ssl/mod.rs
Comment threadtokio-boring/src/bridge.rs Outdated
@nox
noxforce-pushed the async branch 2 times, most recently from df99127 to 2ba3db5CompareSeptember 14, 2023 15:45
Comment threadboring/src/ssl/mod.rs Outdated
Comment threadboring/src/ssl/test/mod.rs
Comment threadboring/src/ssl/mod.rs Outdated
ghedoand 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:masterOct 10, 2023
Sign up for freeto 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

@nox@Noah-Kennedy@ghedo@inikulin@cjpatton