Skip to content

test(ffi): adopt Chromium invalid EC key vectors#314

Open
harrshita123 wants to merge 2 commits into
google:masterfrom
harrshita123:test/chromium-bad-ec-vectors
Open

test(ffi): adopt Chromium invalid EC key vectors#314
harrshita123 wants to merge 2 commits into
google:masterfrom
harrshita123:test/chromium-bad-ec-vectors

Conversation

@harrshita123

Copy link
Copy Markdown
Contributor

Addresses part of #54.

Summary

  • Vendor Chromium's bad_ec_keys.json corpus and license at a pinned revision.
  • Add a repeatable script for updating the vendored files.
  • Add VM-only regression tests covering all 21 malformed EC keys across JWK, SPKI, and PKCS8 imports.

The test reads the vectors from third_party/chromium/ at runtime and keeps the upstream file unchanged, including its comment-only lines. It checks that native ECDSA imports reject each malformed key with a FormatException without depending on Chromium's exact error text.

Browser execution is intentionally left for a follow-up, as discussed in #54.

Testing

  • dart format --output none --set-exit-if-changed .
  • dart analyze --fatal-warnings .
  • dart test test/ffi/chromium_bad_ec_keys_test.dart
  • dart test --exclude-tags browser-interop -p vm,chrome -c dart2js,dart2wasm

Pin Chromium's malformed EC key corpus and license to a reproducible revision. Add an update script that downloads the source files atomically.
Load the pinned malformed EC key corpus from disk and verify that native ECDSA JWK, SPKI, and PKCS8 imports reject every vector with a FormatException.
@harrshita123 harrshita123 force-pushed the test/chromium-bad-ec-vectors branch from 9b2ce4c to fca0171 Compare July 11, 2026 06:44
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.

1 participant