Skip to content

fix: cleanup in gcm tag mismatch#67

Merged
paulmillr merged 1 commit intopaulmillr:mainfrom
ChALkeR:patch-1
Apr 11, 2026
Merged

fix: cleanup in gcm tag mismatch#67
paulmillr merged 1 commit intopaulmillr:mainfrom
ChALkeR:patch-1

Conversation

@ChALkeR
Copy link
Copy Markdown
Contributor

@ChALkeR ChALkeR commented Apr 11, 2026

Wiping [xk, authKey, tagMask, counter] on failure was never done, only on success

See also SIV (which has a better reason to do that though because of plaintext)

noble-ciphers/src/aes.ts

Lines 1137 to 1140 in 4361ffc

if (!equalBytes(tag, expectedTag)) {
clean(...toClean);
throw new Error('invalid polyval tag');
}

No tests seem to fail + no one should be attempting to call decrypt with the same params/instance on failures again I think

@ChALkeR ChALkeR marked this pull request as ready for review April 11, 2026 19:46
@ChALkeR ChALkeR marked this pull request as draft April 11, 2026 19:47
@ChALkeR ChALkeR marked this pull request as ready for review April 11, 2026 19:51
@paulmillr paulmillr merged commit e160698 into paulmillr:main Apr 11, 2026
6 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.

2 participants