Skip to content

webcrypto: reject importKey("jwk") with a missing or wrong kty with DataError - #32901

Closed
robobun wants to merge 4 commits into
mainfrom
farm/5d960045/jwk-kty-dataerror
Closed

webcrypto: reject importKey("jwk") with a missing or wrong kty with DataError#32901
robobun wants to merge 4 commits into
mainfrom
farm/5d960045/jwk-kty-dataerror

[autofix.ci] apply automated fixes

96b406d
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 27, 2026 in 15m 41s

Code review found 1 potential issue

Found 4 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit test/js/web/crypto/web-crypto.test.ts:165-169 unwrapKey JWK regression tests no longer cover the scope.exception() path

Annotations

Check warning on line 169 in test/js/web/crypto/web-crypto.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

unwrapKey JWK regression tests no longer cover the scope.exception() path

Nit: with `kty` no longer required, the wrapped `{foo:"bar"}` payload in these two tests no longer throws inside `convertDictionary<JsonWebKey>`, so they no longer exercise the `scope.exception()` / `m_pendingPromises.remove(index)` branch at SubtleCrypto.cpp:1319-1323 they were written to guard — the rejection now comes from `CryptoKeyAES::importJwk` via the inner `exceptionCallback`, and the comment about "the exception from JsonWebKey dictionary conversion" is stale for this fixture. To keep