Automatic update from web-platform-tests
[WebCrypto] Make serialization tests global-agnostic (#59939)
Use structuredClone() instead of postMessage() to a popup window for
CryptoKey serialization round trips. This keeps the structured clone
coverage while allowing the tests to run in server runtimes.
Rename the tests from .https.window.js to .https.any.js, mark the
Ed448 and X448 cases as tentative, and remove the unused popup page.
--
wpt-commits: 9c77781e3f78e199a99a159081c47d10c22db917
wpt-pr: 59939
Automatic update from web-platform-tests
[WebCrypto] Add WebCryptoAPI WPT for CryptoKey serialization
We added ML-DSA and ML-KEM with broken CryptoKey serialization, but
this wasn't exposed because there was no WPT test for it. Add a WPT test
for serialization by roundtripping a message with a CryptoKey and
comparing the exportKey results.
(The other main way to do CryptoKey serialization is to use an IndexedDB.
Posting messages was simpler.)
Bug: 512509718
Change-Id: I7499ec3a05b6b9e72f22c00e0815f4f847027fe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7842729
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: David Benjamin <[email protected]>
Commit-Queue: Hubert Chao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1631811}
--
wpt-commits: 2aa7252946c8b6d2752d67c08a1ec8230284959a
wpt-pr: 59924
Automatic update from web-platform-tests
[WebCrypto] add supports() method
Add the supports() method from
https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-supports.
In the cases where the algorithm's operation takes in no parameters (and
is not deriveBits/deriveKey), the support checks are done entirely in
third_party/blink/renderer/modules/crypto/subtle_crypto.cc. If the
operation is deriveBits/deriveKey, or algorithm has parameters for the
call (e.g. for decrypt, if its one of the algorithms with parameters
mentioned in
https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/decrypt),
then we call into the algorithm implementation to check if the
parameters need to be checked.
Change-Id: I5778cf6fcff03d9fe454ed7e8d581141f41febf3
Bug: 450627017
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7738892
Reviewed-by: David Benjamin <[email protected]>
Commit-Queue: Hubert Chao <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1623839}
--
wpt-commits: 1f26f6b64332958fdb81cb26e2986cf287b0ade5
wpt-pr: 59595
Automatic update from web-platform-tests
[WebCryptoAPI] Test en/decapsulateKey with extractable=false (#58552)
--
wpt-commits: 4ba708debb74ed59228453364ed91b76bba5085b
wpt-pr: 58552
Automatic update from web-platform-tests
[WebCryptoAPI] Clean up tests for Modern Algorithms (#56447)
--
wpt-commits: 785c0bde8c569a17f92eae8f1fa7ef5ed8bd3d92
wpt-pr: 56447
Automatic update from web-platform-tests
[WebCryptoAPI] Update cSHAKE and KMAC tests to renamed `outputLength` param (#57802)
Update the tests for cSHAKE and KMAC to match the renamed `outputLength`
parameter (from `length`).
--
wpt-commits: 0acea989ac21842d6545d16594f1a05491c6076e
wpt-pr: 57802
Automatic update from web-platform-tests
[WebCryptoAPI] Fix tests of SHA3 and cSHAKE with mutated buffers (#57616)
--
wpt-commits: e28c952dc716416d1d9a9a70458ae9a208950294
wpt-pr: 57616
Automatic update from web-platform-tests
[WebCryptoAPI] Add tests for transferred `ArrayBuffer`s
- When transferring an input buffer during a call to Web Crypto,
the input should be treated as an empty buffer.
- Transferring an input buffer after a call to Web Crypto should
have no effect.
--
[WebCryptoAPI] Fix quotation marks in error messages
--
wpt-commits: bae00f58d79a077345f098443a7126098261ef08, 98fa5caf1316b96a75632295e897a23744e86854
wpt-pr: 57656
Automatic update from web-platform-tests
[WebCrypto] ChaCha20-Poly1305 implementation
Implements components/webcrypto layer going directly to boringssl, tests
in WPT in a virtual test suite, and minor fixes in third_party/blink
that were missed in the first CL.
based on spec at https://wicg.github.io/webcrypto-modern-algos/
Change-Id: I3b6cf19ae9f8103f2b8a7bcb38bc19d34d2cbede
Bug: 450627018
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7055745
Commit-Queue: Hubert Chao <[email protected]>
Reviewed-by: David Benjamin <[email protected]>
Reviewed-by: Ian Kilpatrick <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1594908}
--
wpt-commits: c9e955840a21be6e492225a4a53fc4828d8933b9
wpt-pr: 58297
Automatic update from web-platform-tests
Use EqualIgnoringAsciiCase() in LookupAlgorithmIdByName()
The "Normalizing an algorithm" algorithm[1] says that names should be
matched ASCII case-insensitive [2]. Currently the lookup sort of does
that, but the verifying comparison still uses a full Unicode
case-folding comparison. Because of how the lookup is structured the
lookup for some algorithm names could still accept non-ASCII.
Replace the final DeprecatedEqualIgnoringCase() comparison with
EqualIgnoringAsciiCase().
[1] https://w3c.github.io/webcrypto/#algorithm-normalization-normalize-an-algorithm
[2] https://w3c.github.io/webcrypto/#case-insensitive
Bug: 40476285
Change-Id: If1ee6a3c1e75f271c171b44f8de31fe688546b0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7633022
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Fredrik Söderquist <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1594550}
--
wpt-commits: 9d18397b6447964d44605e0b5e411b6fb87d8cfe
wpt-pr: 58271
Automatic update from web-platform-tests
[WebCryptoAPI] Add tests for argument read order (#57614)
Add tests for the reading order of arguments in Web Crypto, updated in
https://github.com/w3c/webcrypto/pull/426 to match the majority of
implementations.
--
wpt-commits: 42e47329fdc92c80d58c2816eb66cb2cf2b32a89
wpt-pr: 57614
Automatic update from web-platform-tests
WebCryptoAPI Modern Algorithms (#54417)
Implement tentative tests for https://wicg.github.io/webcrypto-modern-algos/.
Includes tests for:
- ML-DSA (no context)
- ML-KEM
- cSHAKE (no customization, no functionName, not inside HMAC, RSA, or HKDF)
- SHA3 (not inside HMAC, RSA, or HKDF)
- ChaCha20-Poly1305
- AES-OCB (not testing variable IV length, only 15-byte ones)
- Argon2 (using just the RFC vectors for passing cases, no failure tests)
- KMAC
- `getPublicKey()` (using generally supported algorithms)
- `supports()` (using generally supported algorithms)
--
wpt-commits: c58b6f4e0eaf8d3b9792f7add1d3dfcbef40053f
wpt-pr: 54417
Automatic update from web-platform-tests
[WebCryptoAPI] Check that JWK import with wrong `crv` field fails not just due to being unimplemented (#54290)
Updated `mismatchedCrvField` in order to check that the import fails
because of an actual mismatch, and not just due to a `NotSuppertedError`
(which Firefox currently throws if the `crv` is not supported).
--
wpt-commits: ff26d9b307b981b3f1b88f454268e6bb8933e6c2
wpt-pr: 54290
Automatic update from web-platform-tests
WebCryptoAPI: Mark Curve448 tests as tentative for now (#53869)
Curve448 is only in WICG/webcrypto-secure-curves for now, not in
w3c/webcrypto yet.
--
wpt-commits: 7813d38f9b7673283051e5fbef273dcba3720794
wpt-pr: 53869
Automatic update from web-platform-tests
WebCryptoAPI: Check that generated JWK public and private keys match (#53680)
When generating extractable key pairs, check that the exported JWK
public key is a superset of the exported JWK private key
(with the exception of the `key_ops` property).
--
wpt-commits: ab08796857072c5a93e27e0a25effba2e07dad11
wpt-pr: 53680
Automatic update from web-platform-tests
WebCrypto: Fix mismatched field tests for ECDH and ECDSA (#53834)
Previously, the tests accidently tested that the implementation returns
an error when `kty` or `crv` is undefined. What was intended is to test
that the field is defined but the value doesn't match. This patch does
so.
--
wpt-commits: a71b0f4bdc14dd5ddbd072c24718d7a8445c2508
wpt-pr: 53834
Automatic update from web-platform-tests
WebCryptoAPI: Test bare algorithm identifiers for {X,Ed}{25519,448} (#53681)
For X25519, X448, Ed25519 and Ed448, it's possible to pass a bare string
as an algorithm identifier, instead of a {name} object. Check that this
works properly.
--
wpt-commits: ca462fc1d12675663fd2fc8dccdecf968657282a
wpt-pr: 53681
Automatic update from web-platform-tests
WebCryptoAPI: Add tests cases for incorrect casing of the 'alg' JWK member (#51788)
--
wpt-commits: b48efd681ea3a5b0daa6b866c3bb54bec895037b
wpt-pr: 51788
Automatic update from web-platform-tests
[WebCryptoAPI] Ensure wrap / unwrap tests run in a consistent order (#49043)
This PR replaces the Promise based wrap / unwrap tests with an
async/await approach. This allows us have a more consistent
expectations for all the test cases and reduce the chances of
flakiness.
This is specially important for WebKit, which compares the text
output of the test against a pre-defined expected.txt.
--
wpt-commits: ecf39b605f4d2b5d7ef4fe344063c2856c9f105c
wpt-pr: 49043
Automatic update from web-platform-tests
Test that calling subtlecrypto methods with empty algorithm objects throws a TypeError
The WebCryptoAPI spec does not tell us which error to throw exactly, but
according to https://webidl.spec.whatwg.org/ it should be a TypeError.
This previously crashed servo.
Signed-off-by: Simon Wülker <[email protected]>
--
wpt-commits: 0cb14c155129281f9b73fb7b2754ae42b99e92f0
wpt-pr: 49141
Automatic update from web-platform-tests
WebCrypto: HDKF and PBKDF2 return an empty ArrayBuffer when length is zero (#49048)
The HKDF and PBKDF2 derive bits operations were changed in [1] to allow
a zero length to be passed and return an empty ArrayBuffer in that case.
This PR updates the tests cases affecting these 2 algorithms in the
cases where zero was passed as the length parameter.
[1] https://github.com/w3c/webcrypto/pull/380
--
wpt-commits: b81831169b8527a6c569a4ad92cf8a1baf4a7118
wpt-pr: 49048
Automatic update from web-platform-tests
Test that CryptoKey.algorithm returns a cached object
Signed-off-by: Simon Wülker <[email protected]>
--
wpt-commits: 71bc66fcf1f521e9142d6382f602eead8d11f5fa
wpt-pr: 48923
Automatic update from web-platform-tests
WebCrypto: Add test for deriving a KDF key using ECDH (#48852)
Check that the correct key is derived when using ECDH to derive an HKDF
or PBKDF2 key.
This test has been ported from WebKit's source [1], defined to check the
impact of the 'Get Key Length' behavior of HKDF and PBKDF2, which should
return 'null' in both cases, in the 'deriveKey' operation.
[1] https://bugs.webkit.org/show_bug.cgi?id=282096
--
wpt-commits: 5f0f4ac1af4848480406621fac99163c8ba0e242
wpt-pr: 48852
Automatic update from web-platform-tests
WebCrypto: Add test cases for deriveBits with too large and non-multiple of 8 lengths (#48471)
--
wpt-commits: 75db68b05454e7f3a81e063373defd094c176a16
wpt-pr: 48471
Automatic update from web-platform-tests
Implement failure tests cases for the EC import operation (#48243)
This PR implements new tests for the import operation of the
ECDH and ECDSA algorithms, defining failure test cases.
Additionally, it applies some refactoring to the code
already used for OKP keys.
--
wpt-commits: 4f0be15407bc43827edcdda8bc1b30a3875c9447
wpt-pr: 48243
Automatic update from web-platform-tests
Split up X25519 and X448 tests (#48195)
The X448 algorithm is not implemented in any of the major browsers, so it's
better to define its deriveBits / deriveKey tests in a separate file to avoid
unnecessary noise on the tests for the X25519 algorithm.
--
wpt-commits: 203d2ac45900139633d4f3f29750ea4b5e06d6f5
wpt-pr: 48195
Automatic update from web-platform-tests
Split Ed448 and Ed25519 sign / verify algorithms (#48207)
The Ed448 algorithm is not implemented in any of the major browsers,
so it's better to define its sign / verify tests in a separate file
to avoid unnecessary noise on the tests for the Ed25519 algorithm.
--
wpt-commits: 4d67f35a4dcc96bc40de00102a150d925d9fca61
wpt-pr: 48207
Automatic update from web-platform-tests
Slit up Curve448 and Curve25519 import tests (#48206)
The Curve448 algorithms are not implemented in any of the major browsers,
so it's better to define its import/export tests in separate files to
avoid unnecessary noise on the tests for the Curve25519 algorithms.
--
wpt-commits: 575f88f3415887e2e2b830882e63308de3621bbc
wpt-pr: 48206