Skip to content

fix(aes-gcm): validate browser tag lengths - #385

Open
harrshita123 wants to merge 1 commit into
google:masterfrom
harrshita123:fix/aes-gcm-tag-length-validation
Open

fix(aes-gcm): validate browser tag lengths#385
harrshita123 wants to merge 1 commit into
google:masterfrom
harrshita123:fix/aes-gcm-tag-length-validation

Conversation

@harrshita123

Copy link
Copy Markdown
Contributor

Summary

  • validate AES-GCM tag lengths in the browser backend before Web Crypto conversion
  • return OperationError for invalid values, matching the native backend
  • cover encryption and decryption through the shared cross-backend test harness

Fixes #384

Testing

  • dart format lib/src/impl_js/impl_js.aesgcm.dart lib/src/testing/regression/aes_gcm_invalid_tag_length.dart lib/src/testing/testing.dart
  • dart analyze --fatal-warnings .
  • dart test -p vm (1,460 passed, 1 existing skip)
  • dart test test/webcrypto_test.dart -p chrome -c dart2js (1,441 passed)
  • dart test test/webcrypto_test.dart -p chrome -c dart2wasm (1,441 passed)

Firefox was not available locally; the repository CI browser matrix provides that coverage.

@harrshita123
harrshita123 marked this pull request as ready for review August 28, 2026 08:03
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.

bug: browser AES-GCM exposes raw JavaScript errors for out-of-range tagLength

1 participant