crypto: refactor WebCrypto AEAD algorithms auth tag handling#62169
Open
panva wants to merge 2 commits intonodejs:mainfrom
Open
crypto: refactor WebCrypto AEAD algorithms auth tag handling#62169panva wants to merge 2 commits intonodejs:mainfrom
panva wants to merge 2 commits intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62169 +/- ##
==========================================
+ Coverage 89.65% 89.67% +0.01%
==========================================
Files 676 676
Lines 206543 206420 -123
Branches 39547 39510 -37
==========================================
- Hits 185184 185102 -82
+ Misses 13480 13463 -17
+ Partials 7879 7855 -24
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
anonrig
approved these changes
Mar 10, 2026
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
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.
Previously JS would split the auth tag from the ciphertext before passing both to the *Job for AEAD decryption. Now the full data is passed to C++, which handles the split and validation internally.
Applies to AES-GCM, AES-OCB, and ChaCha20-Poly1305.
This also fixes an edge case where if
ciphertextis, or is backed by, a detached arraybuffer the spec tells us to treat it as an empty byte sequence. Before we would TypeError on trying to slice it, now we correctly OperationError after C++ handles the ByteSource copy per spec.