Repository navigation
Conversation
This was referenced Nov 19, 2026
…tion With package:boring, every package using BoringSSL on a thread shares its error queue, while webcrypto's own copy of BoringSSL had a separate one. An error that another package left behind was reported as the message of webcrypto's next failure, because extractBoringSslError() reports the least recent (most specific) error. For example, a leftover EC UNKNOWN_GROUP error replaced the DECODE_ERROR of a malformed RSA PKCS#8 key. Run all BoringSSL calls in _arena / _arenaStream, which clear the queue before the operation, like package:boring's README recommends. No other isolate runs on the thread until the operation awaits, and errors are already consumed right after each failing call, so this covers every synchronous call. Results don't change: only error messages could be wrong.
mosuem
force-pushed
the
clear-boringssl-errors
branch
from
November 19, 2026 12:48
5218aa2 to
36756a5
Compare
This branch has not been deployed
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.
Note
This PR was generated by an AI coding agent (Jetski) on behalf of @mosuem.
Replaces #474 (recreated on
google/webcrypto.dartand stacked on #475 viagh stack).With
package:boring, every package using BoringSSL on a thread shares one error queue, whereas webcrypto's own copy of BoringSSL had a separate one. An error that another package leaves behind is then reported as the message of webcrypto's next failure, becauseextractBoringSslError()reports the least recent (most specific) error on the queue.For example, after another package left an EC
UNKNOWN_GROUPerror on the queue:instead of
...:public key routines:OPENSSL_internal:DECODE_ERROR.Change
_arena/_arenaStream, which clear the queue and then runBoringArena.using/BoringArena.stream, and use them for all 31 BoringSSL call sites inlib/src/impl_ffi/. This follows the advice inpackage:boring's README ("CallERR_clear_error()before a call whose errors you report").test/ffi/stale_boringssl_errors_test.dartleaves a stale error, then checks that RSA and EC import failures report their own errors and leave the queue empty. It fails without the fix.All 1585 VM tests pass locally.