tls: defer re-entrant calls to SSL state machine from JS - #65105
Open
pimterry wants to merge 1 commit into
Open
Conversation
Signed-off-by: Tim Perry <pimterry@gmail.com>
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65105 +/- ##
==========================================
- Coverage 90.31% 90.30% -0.02%
==========================================
Files 759 759
Lines 248258 248359 +101
Branches 46854 46867 +13
==========================================
+ Hits 224225 224290 +65
- Misses 15465 15478 +13
- Partials 8568 8591 +23
🚀 New features to boost your workflow:
|
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 is a step towards #65035: making sure that we never mess with the OpenSSL/BoringSSL state machine from inside it.
Rather than hooking each of our callbacks/events inside the SSL library scope, I've wrapped each call that goes into OpenSSL at the top level, and then I'm checking against this in
DoWrite,DoShutdownandCycle, which can be triggered from JS. In each case, if we're inside the SSL library scope (which means we're being called from a JS callback that was triggered by the SSL library) then we defer.This covers some cases that currently work by luck but will break soon in BoringSSL and some cases that already fail today, like the ALPNCallback write example (see #65035 for details).
This just covers SSL_read/SSL_write/SSL_shutdown which are impacted by the pending BoringSSL patch, we may need to review other SSL_set... calls as well later.