From d02e92cbbdf310effef3e35240665dd497c84003 Mon Sep 17 00:00:00 2001 From: Tim Lander <5424257+VirtualTim@users.noreply.github.com> Date: Fri, 16 Oct 2026 17:43:14 +0800 Subject: [PATCH 1/2] Ed25519 support first pass. Supports [sign, verify, importKey] Some tests are failing due to WPT tests targeting an old version of the spec. Does not implement the optional small order check, as it's optional and OpenSSL doesn't support it either. --- builtins/web/crypto/crypto-algorithm.cpp | 437 +++++++++- builtins/web/crypto/crypto-algorithm.h | 28 +- builtins/web/crypto/crypto-key.cpp | 28 + builtins/web/crypto/crypto-key.h | 5 + tests/integration/crypto/crypto.js | 258 ++++++ .../okp_importKey_Ed25519.https.any.js.json | 95 +++ ...portKey_failures_Ed25519.https.any.js.json | 746 ++++++++++++++++++ .../eddsa_curve25519.https.any.js.json | 41 + ...eddsa_small_order_points.https.any.js.json | 44 ++ tests/wpt-harness/tests.json | 4 + 10 files changed, 1682 insertions(+), 4 deletions(-) create mode 100644 tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json create mode 100644 tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json create mode 100644 tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json create mode 100644 tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_small_order_points.https.any.js.json diff --git a/builtins/web/crypto/crypto-algorithm.cpp b/builtins/web/crypto/crypto-algorithm.cpp index de1d2688..e1ebbd76 100644 --- a/builtins/web/crypto/crypto-algorithm.cpp +++ b/builtins/web/crypto/crypto-algorithm.cpp @@ -548,6 +548,9 @@ JS::Result normalizeIdentifier(JSContext *cx, JS::Han if (algorithm == "PBKDF2") { return CryptoAlgorithmIdentifier::PBKDF2; } + if (algorithm == "ED25519") { + return CryptoAlgorithmIdentifier::Ed25519; + } // Otherwise: Return a new NotSupportedError and terminate this algorithm. DOMException::raise(cx, "Algorithm: Unrecognized name", "NotSupportedError"); @@ -625,6 +628,9 @@ const char *algorithmName(CryptoAlgorithmIdentifier algorithm) { case CryptoAlgorithmIdentifier::PBKDF2: { return "PBKDF2"; } + case CryptoAlgorithmIdentifier::Ed25519: { + return "Ed25519"; + } default: { MOZ_ASSERT_UNREACHABLE("Unknown `CryptoAlgorithmIdentifier` value"); } @@ -650,6 +656,7 @@ const char *algorithmName(CryptoAlgorithmIdentifier algorithm) { // | SHA-512 | | | | | ✔ | | | | | | | | // | HKDF | | | | | | | ✔ | ✔ | ✔ | | | | // | PBKDF2 | | | | | | | ✔ | ✔ | ✔ | | | | +// | Ed25519 | | | ✔ | ✔ | | ✔ | | | ✔ | ✔ | | | //clang-format on std::unique_ptr CryptoAlgorithmDigest::normalize(JSContext *cx, @@ -716,7 +723,7 @@ CryptoAlgorithmSignVerify::normalize(JSContext *cx, JS::HandleValue value) { } // The table listed at https://w3c.github.io/webcrypto/#h-note-15 is what defines which algorithms support which operations - // RSASSA-PKCS1-v1_5, RSA-PSS, ECDSA, HMAC, are the algorithms + // RSASSA-PKCS1-v1_5, RSA-PSS, ECDSA, HMAC, Ed25519 are the algorithms // which support the sign operation switch (identifier) { case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: { @@ -728,6 +735,9 @@ CryptoAlgorithmSignVerify::normalize(JSContext *cx, JS::HandleValue value) { case CryptoAlgorithmIdentifier::ECDSA: { return CryptoAlgorithmECDSA_Sign_Verify::fromParameters(cx, params); } + case CryptoAlgorithmIdentifier::Ed25519: { + return std::make_unique(); + } case CryptoAlgorithmIdentifier::RSA_PSS: { MOZ_ASSERT(false); DOMException::raise(cx, "Supplied algorithm is not yet supported", "NotSupportedError"); @@ -1036,6 +1046,90 @@ JSObject *CryptoAlgorithmECDSA_Sign_Verify::toObject(JSContext *cx) { return nullptr; }; +// https://w3c.github.io/webcrypto/#ed25519-operations +JSObject *CryptoAlgorithmEd25519_Sign_Verify::sign(JSContext *cx, JS::HandleObject key, std::span data) { + MOZ_ASSERT(CryptoKey::is_instance(key)); + + // 1. If the [[type]] internal slot of key is not "private", then throw an InvalidAccessError. + if (CryptoKey::type(key) != CryptoKeyType::Private) { + DOMException::raise(cx, "InvalidAccessError", "InvalidAccessError"); + return nullptr; + } + + // 2. Let result be the result of performing the Ed25519 signing process, as specified in [RFC8032], + // Section 5.1.6, with message as M, using the Ed25519 private key associated with key. + // Ed25519 hashes the message as part of the signing process, so no digest algorithm is given. + EvpMdCtxPtr ctx(EVP_MD_CTX_new()); + if (!ctx || EVP_DigestSignInit(ctx.get(), nullptr, nullptr, nullptr, CryptoKey::key(key)) != 1) { + DOMException::raise(cx, "SubtleCrypto.sign: failed to sign", "OperationError"); + return nullptr; + } + + size_t signatureLength = 0; + if (EVP_DigestSign(ctx.get(), nullptr, &signatureLength, data.data(), data.size()) != 1) { + DOMException::raise(cx, "SubtleCrypto.sign: failed to sign", "OperationError"); + return nullptr; + } + mozilla::UniquePtr signature{ + static_cast(JS_malloc(cx, signatureLength))}; + if (!signature) { + JS_ReportOutOfMemory(cx); + return nullptr; + } + + if (EVP_DigestSign(ctx.get(), signature.get(), &signatureLength, data.data(), data.size()) != 1) { + DOMException::raise(cx, "SubtleCrypto.sign: failed to sign", "OperationError"); + return nullptr; + } + + // 3. Return result. + JS::RootedObject buffer(cx, JS::NewArrayBufferWithContents(cx, signatureLength, signature.get(), JS::NewArrayBufferOutOfMemory::CallerMustFreeMemory)); + if (!buffer) { + // We can be here if the array buffer was too large -- if that was the case then a + // JSMSG_BAD_ARRAY_LENGTH will have been created. Otherwise we're probably out of memory. + if (!JS_IsExceptionPending(cx)) { + js::ReportOutOfMemory(cx); + } + return nullptr; + } + + // `signature` is now owned by `buffer` + static_cast(signature.release()); + return buffer; +} + +JS::Result CryptoAlgorithmEd25519_Sign_Verify::verify(JSContext *cx, JS::HandleObject key, std::span signature, std::span data) { + MOZ_ASSERT(CryptoKey::is_instance(key)); + + // 1. If the [[type]] internal slot of key is not "public", then throw an InvalidAccessError. + if (CryptoKey::type(key) != CryptoKeyType::Public) { + DOMException::raise(cx, "InvalidAccessError", "InvalidAccessError"); + return JS::Result(JS::Error()); + } + + // 2. If the key data of key represents an invalid point or a small-order element on the Elliptic + // Curve of Ed25519, return false. + // 3. If the point R, encoded in the first half of signature, represents an invalid point or a + // small-order element on the Elliptic Curve of Ed25519, return false. + // NOTE: The spec notes that not all implementations perform these checks. We rely on OpenSSL, + // which rejects invalid points but does not reject small-order elements. + // 4. Perform the Ed25519 verification steps, as specified in [RFC8032], Section 5.1.7, using the + // cofactorless (unbatched) equation, [S]B = R + [k]A', on the signature, with message as M, + // using the Ed25519 public key associated with key. + EvpMdCtxPtr ctx(EVP_MD_CTX_new()); + if (!ctx || EVP_DigestVerifyInit(ctx.get(), nullptr, nullptr, nullptr, CryptoKey::key(key)) != 1) { + DOMException::raise(cx, "SubtleCrypto.verify: failed to verify", "OperationError"); + return JS::Result(JS::Error()); + } + + // 5. Let result be a boolean with the value true if the signature is valid and the value false + // otherwise. + int ret = EVP_DigestVerify(ctx.get(), signature.data(), signature.size(), data.data(), data.size()); + + // 6. Return result. + return ret == 1; +} + JSObject *CryptoAlgorithmRSASSA_PKCS1_v1_5_Sign_Verify::sign(JSContext *cx, JS::HandleObject key, std::span data) { @@ -1188,8 +1282,8 @@ CryptoAlgorithmImportKey::normalize(JSContext *cx, JS::HandleValue value) { } // The table listed at https://w3c.github.io/webcrypto/#h-note-15 is what defines which algorithms support which operations - // RSASSA-PKCS1-v1_5, RSA-PSS, RSA-OAEP, ECDSA, ECDH, AES-CTR, AES-CBC, AES-GCM, AES-KW, HMAC, HKDF, PBKDF2 are the algorithms - // which support the importKey operation + // RSASSA-PKCS1-v1_5, RSA-PSS, RSA-OAEP, ECDSA, ECDH, AES-CTR, AES-CBC, AES-GCM, AES-KW, HMAC, HKDF, PBKDF2, Ed25519 are the + // algorithms which support the importKey operation switch (identifier) { case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: { return CryptoAlgorithmRSASSA_PKCS1_v1_5_Import::fromParameters(cx, params); @@ -1200,6 +1294,9 @@ CryptoAlgorithmImportKey::normalize(JSContext *cx, JS::HandleValue value) { case CryptoAlgorithmIdentifier::ECDSA: { return CryptoAlgorithmECDSA_Import::fromParameters(cx, params); } + case CryptoAlgorithmIdentifier::Ed25519: { + return std::make_unique(); + } case CryptoAlgorithmIdentifier::RSA_PSS: case CryptoAlgorithmIdentifier::RSA_OAEP: case CryptoAlgorithmIdentifier::AES_CTR: @@ -1930,6 +2027,340 @@ std::unique_ptr CryptoAlgorithmECDSA_Import::fromPa return std::make_unique(namedCurve.unwrap()); } +namespace { +// https://www.rfc-editor.org/rfc/rfc8037#section-2 +// Decodes the base64url encoded "x" or "d" member of an Ed25519 JWK. OpenSSL checks the length. +std::optional decodeEd25519JwkMember(JSContext *cx, const std::optional &member, + std::string_view memberName) { + if (!member.has_value()) { + auto message = fmt::format("The required JWK member '{}' was missing", memberName); + DOMException::raise(cx, message, "DataError"); + return std::nullopt; + } + auto result = base64::forgivingBase64Decode(member.value(), base64::base64URLDecodeTable); + if (result.isErr()) { + auto message = fmt::format("The JWK member '{}' could not be base64url decoded or contained padding", memberName); + DOMException::raise(cx, message, "DataError"); + return std::nullopt; + } + return result.unwrap(); +} + +EvpPkeyPtr createEd25519PublicKeyFromJWK(JSContext *cx, JsonWebKey *jwk) { + auto x = decodeEd25519JwkMember(cx, jwk->x, "x"); + if (!x.has_value()) { + return nullptr; + } + EvpPkeyPtr pkey(EVP_PKEY_new_raw_public_key(EVP_PKEY_ED25519, nullptr, + reinterpret_cast(x->data()), x->size())); + if (!pkey) { + DOMException::raise(cx, "Invalid Ed25519 public key", "DataError"); + return nullptr; + } + return pkey; +} + +EvpPkeyPtr createEd25519PrivateKeyFromJWK(JSContext *cx, JsonWebKey *jwk) { + EvpPkeyPtr publicKey = createEd25519PublicKeyFromJWK(cx, jwk); + if (!publicKey) { + return nullptr; + } + auto d = decodeEd25519JwkMember(cx, jwk->d, "d"); + if (!d.has_value()) { + return nullptr; + } + EvpPkeyPtr pkey(EVP_PKEY_new_raw_private_key(EVP_PKEY_ED25519, nullptr, + reinterpret_cast(d->data()), d->size())); + if (!pkey) { + DOMException::raise(cx, "Invalid Ed25519 private key", "DataError"); + return nullptr; + } + + // The "x" member must be the public key which corresponds to the private key in the "d" member. + if (EVP_PKEY_eq(publicKey.get(), pkey.get()) != 1) { + DOMException::raise(cx, R"(The JWK's "x" member does not match the public key of the "d" member)", "DataError"); + return nullptr; + } + return pkey; +} +} // namespace + +// https://w3c.github.io/webcrypto/#ed25519-operations +JSObject *CryptoAlgorithmEd25519_Import::importKey(JSContext *cx, CryptoKeyFormat format, + KeyData key_data, bool extractable, + CryptoKeyUsages usages) { + // 1. Let keyData be the key data to be imported. + MOZ_ASSERT(cx); + + switch (format) { + // 2. If format is "spki": + case CryptoKeyFormat::Spki: { + // 2.1. If usages contains an entry which is not "verify" then throw a SyntaxError. + if (!usages.isEmpty() && !usages.canOnlyVerify()) { + DOMException::raise(cx, "SPKI public keys only support 'verify' operations", "SyntaxError"); + return nullptr; + } + + // 2.2. Let spki be the result of running the parse a subjectPublicKeyInfo algorithm over keyData. + // 2.3. If an error occurred while parsing, then throw a DataError. + auto keyBytes = std::get>(key_data); + const uint8_t *data = keyBytes.data(); + EvpPkeyPtr pkey(d2i_PUBKEY(nullptr, &data, keyBytes.size())); + if (!pkey || data != keyBytes.data() + keyBytes.size()) { + DOMException::raise(cx, "Invalid SPKI key data", "DataError"); + return nullptr; + } + + // 2.4. If the algorithm object identifier field of the algorithm AlgorithmIdentifier field of spki + // is not equal to the id-Ed25519 object identifier defined in [RFC8410], then throw a DataError. + // 2.5. If the parameters field of the algorithm AlgorithmIdentifier field of spki is present, then + // throw a DataError. + // NOTE: OpenSSL already fails to parse Ed25519 keys which have the parameters field present. + if (EVP_PKEY_id(pkey.get()) != EVP_PKEY_ED25519) { + DOMException::raise(cx, "SPKI key is not an Ed25519 key", "DataError"); + return nullptr; + } + + // 2.6. Let publicKey be the Ed25519 public key identified by the subjectPublicKey field of spki. + // 2.7. Let key be a new CryptoKey that represents publicKey. + // 2.8. Set the [[type]] internal slot of key to "public" + // 2.9. Let algorithm be a new KeyAlgorithm. + // 2.10. Set the name attribute of algorithm to "Ed25519". + // 2.11. Set the [[algorithm]] internal slot of key to algorithm. + return CryptoKey::createEd25519(cx, this, std::move(pkey), CryptoKeyType::Public, extractable, usages); + } + // 2. If format is "pkcs8": + case CryptoKeyFormat::Pkcs8: { + // 2.1. If usages contains an entry which is not "sign" then throw a SyntaxError. + if (!usages.isEmpty() && !usages.canOnlySign()) { + DOMException::raise(cx, "PKCS#8 private keys only support 'sign' operations", "SyntaxError"); + return nullptr; + } + + // 2.2. Let privateKeyInfo be the result of running the parse a privateKeyInfo algorithm over keyData. + // 2.3. If an error occurs while parsing, then throw a DataError. + auto keyBytes = std::get>(key_data); + const uint8_t *data = keyBytes.data(); + EvpPkeyPtr pkey(d2i_PrivateKey(EVP_PKEY_NONE, nullptr, &data, keyBytes.size())); + if (!pkey || data != keyBytes.data() + keyBytes.size()) { + DOMException::raise(cx, "Invalid PKCS#8 key data", "DataError"); + return nullptr; + } + + // 2.4. If the algorithm object identifier field of the privateKeyAlgorithm PrivateKeyAlgorithm + // field of privateKeyInfo is not equal to the id-Ed25519 object identifier defined in + // [RFC8410], then throw a DataError. + // 2.5. If the parameters field of the privateKeyAlgorithm PrivateKeyAlgorithmIdentifier field of + // privateKeyInfo is present, then throw a DataError. + // 2.6. Let curvePrivateKey be the result of performing the parse an ASN.1 structure algorithm, + // with data as the privateKey field of privateKeyInfo, structure as the ASN.1 + // CurvePrivateKey structure specified in Section 7 of [RFC8410], and exactData set to true. + // 2.7. If an error occurred while parsing, then throw a DataError. + // NOTE: OpenSSL already fails to parse Ed25519 keys which have the parameters field present, or + // which do not contain a valid CurvePrivateKey. + if (EVP_PKEY_id(pkey.get()) != EVP_PKEY_ED25519) { + DOMException::raise(cx, "PKCS#8 key is not an Ed25519 key", "DataError"); + return nullptr; + } + + // https://w3c.github.io/webcrypto/#SubtleCrypto-method-importKey + // If the [[type]] internal slot of result is "secret" or "private" and usages is empty, then + // throw a SyntaxError. + if (usages.isEmpty()) { + DOMException::raise(cx, "Usages cannot be empty when importing a private key", "SyntaxError"); + return nullptr; + } + + // 2.8. Let key be a new CryptoKey that represents the Ed25519 private key identified by + // curvePrivateKey. + // 2.9. Set the [[type]] internal slot of key to "private" + // 2.10. Let algorithm be a new KeyAlgorithm. + // 2.11. Set the name attribute of algorithm to "Ed25519". + // 2.12. Set the [[algorithm]] internal slot of key to algorithm. + return CryptoKey::createEd25519(cx, this, std::move(pkey), CryptoKeyType::Private, extractable, usages); + } + // 2. If format is "jwk": + case CryptoKeyFormat::Jwk: { + // 2.1. If keyData is a JsonWebKey dictionary: + // Let jwk equal keyData. + // Otherwise: + // Throw a DataError. + auto *jwk = std::get(key_data); + if (!jwk) { + DOMException::raise(cx, "Supplied keyData is not a JSONWebKey", "DataError"); + return nullptr; + } + + // 2.2. If the d field is present and usages contains a value which is not "sign", or, if the d + // field is not present and usages contains a value which is not "verify" then throw a + // SyntaxError. + const bool isPrivate = jwk->d.has_value(); + if ((isPrivate && !usages.isEmpty() && !usages.canOnlySign()) || + (!isPrivate && !usages.isEmpty() && !usages.canOnlyVerify())) { + DOMException::raise(cx, "Ed25519 keys only support 'sign' and 'verify' operations", "SyntaxError"); + return nullptr; + } + + // 2.3. If the kty field of jwk is not "OKP", then throw a DataError. + // NOTE: This has already been done in the parent function. + + // 2.4. If the crv field of jwk is not "Ed25519", then throw a DataError. + if (jwk->crv.value_or("") != "Ed25519") { + DOMException::raise(cx, R"(The JWK's "crv" member must be "Ed25519")", "DataError"); + return nullptr; + } + + // 2.5. If the alg field of jwk is present and is not "Ed25519" or "EdDSA", then throw a DataError. + if (jwk->alg.has_value() && jwk->alg.value() != "Ed25519" && jwk->alg.value() != "EdDSA") { + DOMException::raise(cx, R"(The JWK's "alg" member must be "Ed25519" or "EdDSA")", "DataError"); + return nullptr; + } + + // 2.6. If usages is non-empty and the use field of jwk is present and is not "sig", then throw a + // DataError. + if (!usages.isEmpty() && jwk->use.has_value() && jwk->use.value() != "sig") { + DOMException::raise(cx, "Operation not permitted", "DataError"); + return nullptr; + } + + // 2.7. If the key_ops field of jwk is present, and is invalid according to the requirements of + // JSON Web Key [JWK], or it does not contain all of the specified usages values, then throw + // a DataError. + if (!jwk->key_ops.empty()) { + auto ops = CryptoKeyUsages::from(jwk->key_ops); + if ((ops.toInt() & usages.toInt()) != usages.toInt()) { + DOMException::raise(cx, + "The JWK 'key_ops' member was inconsistent with that specified by the " + "Web Crypto call. The JWK usage must be a superset of those requested", "DataError"); + return nullptr; + } + } + + // 2.8. If the ext field of jwk is present and has the value false and extractable is true, then + // throw a DataError. + if (jwk->ext && !jwk->ext.value() && extractable) { + DOMException::raise(cx, "Data provided to an operation does not meet requirements", "DataError"); + return nullptr; + } + + // 2.9. If the d field is present: + if (isPrivate) { + // 2.9.1. If jwk does not meet the requirements of the JWK private key format described in + // Section 2 of [RFC8037], then throw a DataError. + // 2.9.2. Let key be a new CryptoKey object that represents the Ed25519 private key identified + // by interpreting jwk according to Section 2 of [RFC8037]. + auto pkey = createEd25519PrivateKeyFromJWK(cx, jwk); + if (!pkey) { + return nullptr; + } + + // https://w3c.github.io/webcrypto/#SubtleCrypto-method-importKey + // If the [[type]] internal slot of result is "secret" or "private" and usages is empty, then + // throw a SyntaxError. + if (usages.isEmpty()) { + DOMException::raise(cx, "Usages cannot be empty when importing a private key", "SyntaxError"); + return nullptr; + } + + // 2.9.3. Set the [[type]] internal slot of Key to "private". + // 2.10. Let algorithm be a new instance of a KeyAlgorithm object. + // 2.11. Set the name attribute of algorithm to "Ed25519". + // 2.12. Set the [[algorithm]] internal slot of key to algorithm. + return CryptoKey::createEd25519(cx, this, std::move(pkey), CryptoKeyType::Private, extractable, usages); + } + // Otherwise: + // 2.9.1. If jwk does not meet the requirements of the JWK public key format described in + // Section 2 of [RFC8037], then throw a DataError. + // 2.9.2. Let key be a new CryptoKey object that represents the Ed25519 public key identified by + // interpreting jwk according to Section 2 of [RFC8037]. + auto pkey = createEd25519PublicKeyFromJWK(cx, jwk); + if (!pkey) { + return nullptr; + } + // 2.9.3. Set the [[type]] internal slot of Key to "public". + // 2.10. Let algorithm be a new instance of a KeyAlgorithm object. + // 2.11. Set the name attribute of algorithm to "Ed25519". + // 2.12. Set the [[algorithm]] internal slot of key to algorithm. + return CryptoKey::createEd25519(cx, this, std::move(pkey), CryptoKeyType::Public, extractable, usages); + } + // 2. If format is "raw": + case CryptoKeyFormat::Raw: { + // 2.1. If usages contains an entry which is not "verify" then throw a SyntaxError. + if (!usages.isEmpty() && !usages.canOnlyVerify()) { + DOMException::raise(cx, "Raw public keys only support 'verify' operations", "SyntaxError"); + return nullptr; + } + + // 2.2. If the length in bits of keyData is not 256 then throw a DataError. + // EVP_PKEY_new_raw_public_key below rejects any other length. + auto keyBytes = std::get>(key_data); + + // 2.3. Let algorithm be a new KeyAlgorithm object. + // 2.4. Set the name attribute of algorithm to "Ed25519". + // 2.5. Let key be a new CryptoKey representing the key data provided in keyData. + // 2.6. Set the [[type]] internal slot of key to "public" + // 2.7. Set the [[algorithm]] internal slot of key to algorithm. + EvpPkeyPtr pkey(EVP_PKEY_new_raw_public_key(EVP_PKEY_ED25519, nullptr, keyBytes.data(), keyBytes.size())); + if (!pkey) { + DOMException::raise(cx, "Invalid Ed25519 public key", "DataError"); + return nullptr; + } + return CryptoKey::createEd25519(cx, this, std::move(pkey), CryptoKeyType::Public, extractable, usages); + } + } + return nullptr; +} + +JSObject *CryptoAlgorithmEd25519_Import::importKey(JSContext *cx, CryptoKeyFormat format, JS::HandleValue key_data, bool extractable, + CryptoKeyUsages usages) { + MOZ_ASSERT(cx); + + std::unique_ptr jwk; + KeyData data; + switch (format) { + case CryptoKeyFormat::Jwk: { + // This handles step 2.3: If the kty field of jwk is not "OKP", then throw a DataError. + jwk = JsonWebKey::parse(cx, key_data, "OKP"); + if (!jwk) { + return nullptr; + } + data = jwk.get(); + break; + } + case CryptoKeyFormat::Pkcs8: + case CryptoKeyFormat::Spki: + case CryptoKeyFormat::Raw: { + std::optional> buffer = value_to_buffer(cx, key_data, ""); + if (!buffer.has_value()) { + return nullptr; + } + data = buffer.value(); + break; + } + } + + return this->importKey(cx, format, data, extractable, usages); +} + +JSObject *CryptoAlgorithmEd25519_Import::toObject(JSContext *cx) const { + // Let algorithm be a new KeyAlgorithm dictionary. + JS::RootedObject algorithm(cx, JS_NewPlainObject(cx)); + if (!algorithm) { + return nullptr; + } + + // Set the name attribute of algorithm to "Ed25519". + auto *alg_name = JS_NewStringCopyZ(cx, this->name()); + if (!alg_name) { + return nullptr; + } + JS::RootedValue name_val(cx, JS::StringValue(alg_name)); + if (!JS_SetProperty(cx, algorithm, "name", name_val)) { + return nullptr; + } + return algorithm; +} + std::unique_ptr CryptoAlgorithmRSASSA_PKCS1_v1_5_Import::fromParameters(JSContext *cx, JS::HandleObject parameters) { JS::Rooted hash_val(cx); if (!JS_GetProperty(cx, parameters, "hash", &hash_val)) { diff --git a/builtins/web/crypto/crypto-algorithm.h b/builtins/web/crypto/crypto-algorithm.h index df468d79..0d2e1ddd 100644 --- a/builtins/web/crypto/crypto-algorithm.h +++ b/builtins/web/crypto/crypto-algorithm.h @@ -33,7 +33,8 @@ enum class CryptoAlgorithmIdentifier : uint8_t { SHA_384, SHA_512, HKDF, - PBKDF2 + PBKDF2, + Ed25519 }; enum class NamedCurve : uint8_t { @@ -135,6 +136,31 @@ class CryptoAlgorithmECDSA_Import final : public CryptoAlgorithmImportKey { JSObject *toObject(JSContext *cx) const; }; +class CryptoAlgorithmEd25519_Sign_Verify final : public CryptoAlgorithmSignVerify { +public: + [[nodiscard]] const char *name() const noexcept override { return "Ed25519"; }; + CryptoAlgorithmEd25519_Sign_Verify() = default; + CryptoAlgorithmIdentifier identifier() final { return CryptoAlgorithmIdentifier::Ed25519; }; + + JSObject *sign(JSContext *cx, JS::HandleObject key, std::span data) override; + JS::Result verify(JSContext *cx, JS::HandleObject key, std::span signature, + std::span data) override; +}; + +class CryptoAlgorithmEd25519_Import final : public CryptoAlgorithmImportKey { +public: + [[nodiscard]] const char *name() const noexcept override { return "Ed25519"; }; + CryptoAlgorithmEd25519_Import() = default; + + CryptoAlgorithmIdentifier identifier() final { return CryptoAlgorithmIdentifier::Ed25519; }; + + JSObject *importKey(JSContext *cx, CryptoKeyFormat format, JS::HandleValue key_data, bool extractable, + CryptoKeyUsages usages) override; + JSObject *importKey(JSContext *cx, CryptoKeyFormat format, KeyData key_data, bool extractable, + CryptoKeyUsages usages) override; + JSObject *toObject(JSContext *cx) const; +}; + class CryptoAlgorithmRSASSA_PKCS1_v1_5_Sign_Verify final : public CryptoAlgorithmSignVerify { public: [[nodiscard]] const char *name() const noexcept override { return "RSASSA-PKCS1-v1_5"; }; diff --git a/builtins/web/crypto/crypto-key.cpp b/builtins/web/crypto/crypto-key.cpp index 3780d039..a1d5e6b7 100644 --- a/builtins/web/crypto/crypto-key.cpp +++ b/builtins/web/crypto/crypto-key.cpp @@ -678,6 +678,34 @@ JSObject *CryptoKey::createECDSA(JSContext *cx, CryptoAlgorithmECDSA_Import *alg return instance; } +JSObject *CryptoKey::createEd25519(JSContext *cx, CryptoAlgorithmEd25519_Import *algorithm, + EvpPkeyPtr pkey, CryptoKeyType keyType, bool extractable, + CryptoKeyUsages usages) { + MOZ_ASSERT(cx); + MOZ_ASSERT(algorithm); + MOZ_ASSERT(pkey); + MOZ_ASSERT(EVP_PKEY_id(pkey.get()) == EVP_PKEY_ED25519); + MOZ_ASSERT(keyType == CryptoKeyType::Public || keyType == CryptoKeyType::Private); + + JS::RootedObject instance( + cx, JS_NewObjectWithGivenProto(cx, &CryptoKey::class_, CryptoKey::proto_obj)); + if (!instance) { + return nullptr; + } + + JS::RootedObject alg(cx, algorithm->toObject(cx)); + if (!alg) { + return nullptr; + } + + JS::SetReservedSlot(instance, std::to_underlying(Slots::Algorithm), JS::ObjectValue(*alg)); + JS::SetReservedSlot(instance, std::to_underlying(Slots::Type), JS::Int32Value(static_cast(keyType))); + JS::SetReservedSlot(instance, std::to_underlying(Slots::Extractable), JS::BooleanValue(extractable)); + JS::SetReservedSlot(instance, std::to_underlying(Slots::Usages), JS::Int32Value(usages.toInt())); + JS::SetReservedSlot(instance, std::to_underlying(Slots::Key), JS::PrivateValue(pkey.release())); + return instance; +} + JSObject *CryptoKey::createRSA(JSContext *cx, CryptoAlgorithmRSASSA_PKCS1_v1_5_Import *algorithm, std::unique_ptr keyData, bool extractable, CryptoKeyUsages usages) { diff --git a/builtins/web/crypto/crypto-key.h b/builtins/web/crypto/crypto-key.h index 58187885..8359f6c2 100644 --- a/builtins/web/crypto/crypto-key.h +++ b/builtins/web/crypto/crypto-key.h @@ -5,6 +5,7 @@ #include "crypto-key-ec-components.h" #include "crypto-key-rsa-components.h" +#include "crypto-raii.h" #include "openssl/evp.h" @@ -14,6 +15,7 @@ enum class CryptoAlgorithmIdentifier : uint8_t; class CryptoAlgorithmRSASSA_PKCS1_v1_5_Import; class CryptoAlgorithmHMAC_Import; class CryptoAlgorithmECDSA_Import; +class CryptoAlgorithmEd25519_Import; enum class CryptoKeyType : uint8_t { Public, Private, Secret }; enum class CryptoKeyFormat : uint8_t { Raw, Spki, Pkcs8, Jwk }; @@ -129,6 +131,9 @@ class CryptoKey : public BuiltinNoConstructor { static JSObject *createECDSA(JSContext *cx, CryptoAlgorithmECDSA_Import *algorithm, std::unique_ptr keyData, bool extractable, CryptoKeyUsages usages); + static JSObject *createEd25519(JSContext *cx, CryptoAlgorithmEd25519_Import *algorithm, + EvpPkeyPtr pkey, CryptoKeyType keyType, bool extractable, + CryptoKeyUsages usages); static CryptoKeyType type(JSObject *self); static JSObject *get_algorithm(JS::HandleObject self); static EVP_PKEY *key(JSObject *self); diff --git a/tests/integration/crypto/crypto.js b/tests/integration/crypto/crypto.js index cd152ecb..d306cdd9 100644 --- a/tests/integration/crypto/crypto.js +++ b/tests/integration/crypto/crypto.js @@ -138,6 +138,54 @@ const rsaPkcs1Sha512Algorithm = { hash: { name: "SHA-512" }, }; +// From https://www.rfc-editor.org/rfc/rfc8032#section-7.1 TEST 1 +const ed25519Test1PublicJsonWebKeyData = () => ({ + kty: "OKP", + crv: "Ed25519", + x: "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + ext: true, + key_ops: ["verify"], +}); +const ed25519Test1PrivateJsonWebKeyData = () => ({ + kty: "OKP", + crv: "Ed25519", + x: "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + d: "nWGxne_9WmC6hEr0kuwsxERJxWl7MmkZcDusAxyuf2A", + ext: true, + key_ops: ["sign"], +}); +const ed25519Test1Raw = new Uint8Array([ + 215, 90, 152, 1, 130, 177, 10, 183, 213, 75, 254, 211, 201, 100, 7, 58, + 14, 225, 114, 243, 218, 166, 35, 37, 175, 2, 26, 104, 247, 7, 81, 26, +]); +// The message for TEST 1 is empty. +const ed25519Test1Signature = new Uint8Array([ + 229, 86, 67, 0, 195, 96, 172, 114, 144, 134, 226, 204, 128, 110, 130, 138, + 132, 135, 127, 30, 184, 229, 217, 116, 216, 115, 224, 101, 34, 73, 1, 85, + 95, 184, 130, 21, 144, 163, 59, 172, 198, 30, 57, 112, 28, 249, 180, 107, + 210, 91, 245, 240, 89, 91, 190, 36, 101, 81, 65, 67, 142, 122, 16, 11, +]); + +// From https://www.rfc-editor.org/rfc/rfc8032#section-7.1 TEST 2 +const ed25519Test2Spki = new Uint8Array([ + 48, 42, 48, 5, 6, 3, 43, 101, 112, 3, 33, 0, 61, 64, 23, 195, + 232, 67, 137, 90, 146, 183, 10, 167, 77, 27, 126, 188, 156, 152, 44, 207, + 46, 196, 150, 140, 192, 205, 85, 241, 42, 244, 102, 12, +]); +const ed25519Test2Pkcs8 = new Uint8Array([ + 48, 46, 2, 1, 0, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32, + 76, 205, 8, 155, 40, 255, 150, 218, 157, 182, 195, 70, 236, 17, 78, 15, + 91, 138, 49, 159, 53, 171, 166, 36, 218, 140, 246, 237, 79, 184, 166, 251, +]); +const ed25519Test2Message = new Uint8Array([0x72]); +const ed25519Test2Signature = new Uint8Array([ + 146, 160, 9, 169, 240, 212, 202, 184, 114, 14, 130, 11, 95, 100, 37, 64, + 162, 178, 123, 84, 22, 80, 63, 143, 179, 118, 34, 35, 235, 219, 105, 218, + 8, 90, 193, 228, 62, 21, 153, 110, 69, 143, 54, 19, 208, 241, 29, 140, + 56, 123, 46, 174, 180, 48, 42, 238, 176, 13, 41, 22, 18, 187, 12, 0, +]); + + export const handler = serveTest(async (t) => { t.test("crypto", () => { strictEqual(typeof crypto, "object", `typeof crypto`); @@ -2534,4 +2582,214 @@ export const handler = serveTest(async (t) => { }); } } + + // Ed25519 + { + const ed25519Algorithm = { name: "Ed25519" }; + const assertEd25519Key = (key, type, extractable, usages) => { + strictEqual(key instanceof CryptoKey, true, "key instanceof CryptoKey"); + deepStrictEqual(key.algorithm, { name: "Ed25519" }, "key.algorithm"); + strictEqual(key.extractable, extractable, "key.extractable"); + strictEqual(key.type, type, "key.type"); + deepStrictEqual(key.usages, usages, "key.usages"); + }; + + // importKey happy paths + await t.test("ed25519-import-raw", async () => { + const key = await crypto.subtle.importKey("raw", ed25519Test1Raw, ed25519Algorithm, true, ["verify"]); + assertEd25519Key(key, "public", true, ["verify"]); + }); + await t.test("ed25519-import-raw-empty-usages", async () => { + const key = await crypto.subtle.importKey("raw", ed25519Test1Raw, ed25519Algorithm, false, []); + assertEd25519Key(key, "public", false, []); + }); + await t.test("ed25519-import-spki", async () => { + const key = await crypto.subtle.importKey("spki", ed25519Test2Spki, ed25519Algorithm, true, ["verify"]); + assertEd25519Key(key, "public", true, ["verify"]); + }); + await t.test("ed25519-import-pkcs8", async () => { + const key = await crypto.subtle.importKey("pkcs8", ed25519Test2Pkcs8, ed25519Algorithm, false, ["sign"]); + assertEd25519Key(key, "private", false, ["sign"]); + }); + await t.test("ed25519-import-jwk-public", async () => { + const jwk = ed25519Test1PublicJsonWebKeyData(); + const key = await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, jwk.ext, jwk.key_ops); + assertEd25519Key(key, "public", true, ["verify"]); + }); + await t.test("ed25519-import-jwk-private", async () => { + const jwk = ed25519Test1PrivateJsonWebKeyData(); + const key = await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, jwk.ext, jwk.key_ops); + assertEd25519Key(key, "private", true, ["sign"]); + }); + await t.test("ed25519-import-jwk-alg", async () => { + for (const alg of ["Ed25519", "EdDSA"]) { + const jwk = { ...ed25519Test1PublicJsonWebKeyData(), alg }; + const key = await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, true, ["verify"]); + assertEd25519Key(key, "public", true, ["verify"]); + } + }); + await t.test("ed25519-import-algorithm-name-is-case-insensitive", async () => { + const key = await crypto.subtle.importKey("raw", ed25519Test1Raw, "ed25519", true, ["verify"]); + assertEd25519Key(key, "public", true, ["verify"]); + }); + + // importKey failures + await t.test("ed25519-import-raw-sign-usage", async () => { + await rejects(async () => { + await crypto.subtle.importKey("raw", ed25519Test1Raw, ed25519Algorithm, true, ["sign"]); + }, DOMException, undefined, "SyntaxError"); + }); + await t.test("ed25519-import-raw-wrong-length", async () => { + await rejects(async () => { + await crypto.subtle.importKey("raw", ed25519Test1Raw.slice(1), ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-spki-sign-usage", async () => { + await rejects(async () => { + await crypto.subtle.importKey("spki", ed25519Test2Spki, ed25519Algorithm, true, ["sign"]); + }, DOMException, undefined, "SyntaxError"); + }); + await t.test("ed25519-import-spki-trailing-data", async () => { + const spki = new Uint8Array([...ed25519Test2Spki, 0]); + await rejects(async () => { + await crypto.subtle.importKey("spki", spki, ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-spki-ecdsa-key", async () => { + await rejects(async () => { + await crypto.subtle.importKey("spki", ecdsaP256Spki, ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-pkcs8-verify-usage", async () => { + await rejects(async () => { + await crypto.subtle.importKey("pkcs8", ed25519Test2Pkcs8, ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "SyntaxError"); + }); + await t.test("ed25519-import-pkcs8-empty-usages", async () => { + await rejects(async () => { + await crypto.subtle.importKey("pkcs8", ed25519Test2Pkcs8, ed25519Algorithm, true, []); + }, DOMException, undefined, "SyntaxError"); + }); + await t.test("ed25519-import-pkcs8-ecdsa-key", async () => { + await rejects(async () => { + await crypto.subtle.importKey("pkcs8", ecdsaP256Pkcs8, ed25519Algorithm, true, ["sign"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-jwk-private-empty-usages", async () => { + await rejects(async () => { + await crypto.subtle.importKey("jwk", ed25519Test1PrivateJsonWebKeyData(), ed25519Algorithm, true, []); + }, DOMException, undefined, "SyntaxError"); + }); + await t.test("ed25519-import-jwk-wrong-kty", async () => { + const jwk = { ...ed25519Test1PublicJsonWebKeyData(), kty: "EC" }; + await rejects(async () => { + await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-jwk-wrong-crv", async () => { + const jwk = { ...ed25519Test1PublicJsonWebKeyData(), crv: "X25519" }; + await rejects(async () => { + await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-jwk-wrong-alg", async () => { + const jwk = { ...ed25519Test1PublicJsonWebKeyData(), alg: "ES256" }; + await rejects(async () => { + await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-jwk-missing-x", async () => { + const { x, ...jwk } = ed25519Test1PrivateJsonWebKeyData(); + await rejects(async () => { + await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, true, ["sign"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-jwk-mismatched-x-and-d", async () => { + const jwk = { ...ed25519Test1PrivateJsonWebKeyData(), x: "PUAXw-hDiVqStwqnTRt-vJyYLM8uxJaMwM1V8Sr0Zgw" }; + await rejects(async () => { + await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, true, ["sign"]); + }, DOMException, undefined, "DataError"); + }); + await t.test("ed25519-import-jwk-key-ops-not-superset", async () => { + const jwk = { ...ed25519Test1PublicJsonWebKeyData(), key_ops: ["sign"] }; + await rejects(async () => { + await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, true, ["verify"]); + }, DOMException, undefined, "DataError"); + }); + + // sign + await t.test("ed25519-sign-pkcs8", async () => { + const key = await crypto.subtle.importKey("pkcs8", ed25519Test2Pkcs8, ed25519Algorithm, false, ["sign"]); + const signature = new Uint8Array(await crypto.subtle.sign(ed25519Algorithm, key, ed25519Test2Message)); + deepStrictEqual(signature, ed25519Test2Signature, "signature deep equals expected"); + }); + await t.test("ed25519-sign-jwk-empty-message", async () => { + const jwk = ed25519Test1PrivateJsonWebKeyData(); + const key = await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, false, ["sign"]); + const signature = new Uint8Array(await crypto.subtle.sign("Ed25519", key, new Uint8Array())); + deepStrictEqual(signature, ed25519Test1Signature, "signature deep equals expected"); + }); + await t.test("ed25519-sign-with-public-key", async () => { + const key = await crypto.subtle.importKey("raw", ed25519Test1Raw, ed25519Algorithm, false, ["verify"]); + await rejects(async () => { + await crypto.subtle.sign(ed25519Algorithm, key, new Uint8Array()); + }, DOMException, undefined, "InvalidAccessError"); + }); + await t.test("ed25519-sign-with-ecdsa-algorithm", async () => { + const key = await crypto.subtle.importKey("pkcs8", ed25519Test2Pkcs8, ed25519Algorithm, false, ["sign"]); + await rejects(async () => { + await crypto.subtle.sign({ name: "ECDSA", hash: "SHA-256" }, key, ed25519Test2Message); + }, DOMException, undefined, "InvalidAccessError"); + }); + + // verify + await t.test("ed25519-verify-spki", async () => { + const key = await crypto.subtle.importKey("spki", ed25519Test2Spki, ed25519Algorithm, false, ["verify"]); + const result = await crypto.subtle.verify(ed25519Algorithm, key, ed25519Test2Signature, ed25519Test2Message); + strictEqual(result, true, "result"); + }); + await t.test("ed25519-verify-raw-empty-message", async () => { + const key = await crypto.subtle.importKey("raw", ed25519Test1Raw, ed25519Algorithm, false, ["verify"]); + const result = await crypto.subtle.verify(ed25519Algorithm, key, ed25519Test1Signature, new Uint8Array()); + strictEqual(result, true, "result"); + }); + await t.test("ed25519-verify-jwk", async () => { + const jwk = ed25519Test1PublicJsonWebKeyData(); + const key = await crypto.subtle.importKey("jwk", jwk, ed25519Algorithm, false, ["verify"]); + const result = await crypto.subtle.verify(ed25519Algorithm, key, ed25519Test1Signature, new Uint8Array()); + strictEqual(result, true, "result"); + }); + await t.test("ed25519-verify-sign-round-trip", async () => { + const privateKey = await crypto.subtle.importKey("pkcs8", ed25519Test2Pkcs8, ed25519Algorithm, false, ["sign"]); + const publicKey = await crypto.subtle.importKey("spki", ed25519Test2Spki, ed25519Algorithm, false, ["verify"]); + const message = new TextEncoder().encode("StarlingMonkey"); + const signature = await crypto.subtle.sign(ed25519Algorithm, privateKey, message); + strictEqual(await crypto.subtle.verify(ed25519Algorithm, publicKey, signature, message), true, "result"); + }); + await t.test("ed25519-verify-altered-signature", async () => { + const key = await crypto.subtle.importKey("spki", ed25519Test2Spki, ed25519Algorithm, false, ["verify"]); + const signature = ed25519Test2Signature.slice(); + signature[0] ^= 1; + const result = await crypto.subtle.verify(ed25519Algorithm, key, signature, ed25519Test2Message); + strictEqual(result, false, "result"); + }); + await t.test("ed25519-verify-altered-message", async () => { + const key = await crypto.subtle.importKey("spki", ed25519Test2Spki, ed25519Algorithm, false, ["verify"]); + const result = await crypto.subtle.verify(ed25519Algorithm, key, ed25519Test2Signature, new Uint8Array([0x73])); + strictEqual(result, false, "result"); + }); + await t.test("ed25519-verify-wrong-signature-length", async () => { + const key = await crypto.subtle.importKey("spki", ed25519Test2Spki, ed25519Algorithm, false, ["verify"]); + for (const signature of [ed25519Test2Signature.slice(1), new Uint8Array([...ed25519Test2Signature, 0])]) { + const result = await crypto.subtle.verify(ed25519Algorithm, key, signature, ed25519Test2Message); + strictEqual(result, false, "result"); + } + }); + await t.test("ed25519-verify-with-private-key", async () => { + const key = await crypto.subtle.importKey("pkcs8", ed25519Test2Pkcs8, ed25519Algorithm, false, ["sign"]); + await rejects(async () => { + await crypto.subtle.verify(ed25519Algorithm, key, ed25519Test2Signature, ed25519Test2Message); + }, DOMException, undefined, "InvalidAccessError"); + }); + } }); diff --git a/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json new file mode 100644 index 00000000..fe1035c1 --- /dev/null +++ b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json @@ -0,0 +1,95 @@ +{ + "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Good parameters with ignored JWK alg: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, [])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, [])": { + "status": "FAIL" + }, + "Good parameters with ignored JWK alg: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, true, [])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters with ignored JWK alg: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, true, [sign])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign])": { + "status": "FAIL" + }, + "Good parameters with ignored JWK alg: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, true, [sign, sign])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign, sign])": { + "status": "FAIL" + }, + "Good parameters with ignored JWK alg: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign, sign])": { + "status": "FAIL" + }, + "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, [])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, [])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, false, [])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, [verify, verify])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, [verify, verify])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, false, [verify, verify])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, false, [sign, sign])": { + "status": "PASS" + }, + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, false, [sign, sign])": { + "status": "PASS" + } +} \ No newline at end of file diff --git a/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json new file mode 100644 index 00000000..9d55c3be --- /dev/null +++ b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json @@ -0,0 +1,746 @@ +{ + "Bad usages: importKey(spki, {name: Ed25519}, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Empty usages: importKey(pkcs8, {name: Ed25519}, true, [])": { + "status": "PASS" + }, + "Empty usages: importKey(pkcs8, {name: Ed25519}, false, [])": { + "status": "PASS" + }, + "Empty usages: importKey(jwk(private), {name: Ed25519}, true, [])": { + "status": "PASS" + }, + "Empty usages: importKey(jwk(private), {name: Ed25519}, false, [])": { + "status": "PASS" + }, + "Bad key length: importKey(spki, {name: Ed25519}, true, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(spki, {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(spki, {name: Ed25519}, true, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(spki, {name: Ed25519}, false, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, {name: Ed25519}, true, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, {name: Ed25519}, false, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, {name: Ed25519}, true, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, {name: Ed25519}, true, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, {name: Ed25519}, false, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), {name: Ed25519}, true, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), {name: Ed25519}, false, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify])": { + "status": "PASS" + }, + "Missing JWK 'x' parameter: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Missing JWK 'x' parameter: importKey(jwk(private), {name: Ed25519}, false, [sign])": { + "status": "PASS" + }, + "Missing JWK 'x' parameter: importKey(jwk(private), {name: Ed25519}, true, [sign, sign])": { + "status": "PASS" + }, + "Missing JWK 'x' parameter: importKey(jwk(private), {name: Ed25519}, false, [sign, sign])": { + "status": "PASS" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "FAIL" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), {name: Ed25519}, false, [sign])": { + "status": "FAIL" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), {name: Ed25519}, true, [sign, sign])": { + "status": "FAIL" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), {name: Ed25519}, false, [sign, sign])": { + "status": "FAIL" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "PASS" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , {name: Ed25519}, false, [verify])": { + "status": "PASS" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify])": { + "status": "PASS" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify])": { + "status": "PASS" + }, + "Invalid key pair: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Invalid key pair: importKey(jwk(private), {name: Ed25519}, true, [sign, sign])": { + "status": "PASS" + } +} \ No newline at end of file diff --git a/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json b/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json new file mode 100644 index 00000000..42c4847c --- /dev/null +++ b/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json @@ -0,0 +1,41 @@ +{ + "EdDSA Ed25519 verification": { + "status": "PASS" + }, + "EdDSA Ed25519 verification with altered signature after call": { + "status": "PASS" + }, + "EdDSA Ed25519 with altered data after call": { + "status": "PASS" + }, + "EdDSA Ed25519 using privateKey to verify": { + "status": "PASS" + }, + "EdDSA Ed25519 using publicKey to sign": { + "status": "PASS" + }, + "EdDSA Ed25519 no verify usage": { + "status": "PASS" + }, + "EdDSA Ed25519 round trip": { + "status": "PASS" + }, + "EdDSA Ed25519 signing with wrong algorithm name": { + "status": "FAIL" + }, + "EdDSA Ed25519 verifying with wrong algorithm name": { + "status": "FAIL" + }, + "EdDSA Ed25519 verification failure due to altered signature": { + "status": "PASS" + }, + "EdDSA Ed25519 verification failure due to shortened signature": { + "status": "PASS" + }, + "EdDSA Ed25519 verification failure due to altered data": { + "status": "PASS" + }, + "Sign and verify using generated Ed25519 keys.": { + "status": "FAIL" + } +} \ No newline at end of file diff --git a/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_small_order_points.https.any.js.json b/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_small_order_points.https.any.js.json new file mode 100644 index 00000000..4ac903eb --- /dev/null +++ b/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_small_order_points.https.any.js.json @@ -0,0 +1,44 @@ +{ + "Ed25519 Verification checks with small-order key of order - Test 0": { + "status": "FAIL" + }, + "Ed25519 Verification checks with small-order key of order - Test 1": { + "status": "FAIL" + }, + "Ed25519 Verification checks with small-order key of order - Test 2": { + "status": "FAIL" + }, + "Ed25519 Verification checks with small-order key of order - Test 3": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 4": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 5": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 6": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 7": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 8": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 9": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 10": { + "status": "PASS" + }, + "Ed25519 Verification checks with small-order key of order - Test 11": { + "status": "FAIL" + }, + "Ed25519 Verification checks with small-order key of order - Test 12": { + "status": "FAIL" + }, + "Ed25519 Verification checks with small-order key of order - Test 13": { + "status": "FAIL" + } +} \ No newline at end of file diff --git a/tests/wpt-harness/tests.json b/tests/wpt-harness/tests.json index df1e73ce..84f0538c 100644 --- a/tests/wpt-harness/tests.json +++ b/tests/wpt-harness/tests.json @@ -286,8 +286,12 @@ "WebCryptoAPI/getRandomValues.any.js", "WebCryptoAPI/idlharness.https.any.js", "WebCryptoAPI/import_export/ec_importKey.https.any.js", + "WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js", + "WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js", "WebCryptoAPI/randomUUID.https.any.js", "WebCryptoAPI/sign_verify/ecdsa.https.any.js", + "WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js", + "WebCryptoAPI/sign_verify/eddsa_small_order_points.https.any.js", "WebCryptoAPI/sign_verify/hmac.https.any.js", "html/webappapis/structured-clone/structured-clone.any.js", "html/webappapis/timers/clearinterval-from-callback.any.js", From 2392bce188059a0e4aff10262e252f1144504da2 Mon Sep 17 00:00:00 2001 From: Tim Lander <5424257+VirtualTim@users.noreply.github.com> Date: Tue, 20 Oct 2026 08:42:05 +0800 Subject: [PATCH 2/2] Regenerate WPT test expectations. --- .../okp_importKey_Ed25519.https.any.js.json | 133 +- ...portKey_failures_Ed25519.https.any.js.json | 1586 ++++++++++++++++- .../eddsa_curve25519.https.any.js.json | 18 + 3 files changed, 1722 insertions(+), 15 deletions(-) diff --git a/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json index fe1035c1..43db772a 100644 --- a/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json +++ b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.js.json @@ -2,94 +2,217 @@ "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, [verify])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (spki, buffer(44), Ed25519, true, [verify])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify])": { "status": "FAIL" }, - "Good parameters with ignored JWK alg: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify])": { + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), Ed25519, true, [verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(kty, crv, x), Ed25519, true, [verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(kty, crv, x), Ed25519, true, [verify])": { "status": "FAIL" }, "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, true, [verify])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (raw, buffer(32), Ed25519, true, [verify])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, [])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (spki, buffer(44), Ed25519, true, [])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, [])": { "status": "FAIL" }, - "Good parameters with ignored JWK alg: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [])": { + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), Ed25519, true, [])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(kty, crv, x), Ed25519, true, [])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(kty, crv, x), Ed25519, true, [])": { "status": "FAIL" }, "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, true, [])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (raw, buffer(32), Ed25519, true, [])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, [verify, verify])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (spki, buffer(44), Ed25519, true, [verify, verify])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify, verify])": { "status": "FAIL" }, - "Good parameters with ignored JWK alg: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify, verify])": { + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), Ed25519, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(kty, crv, x), {name: Ed25519}, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(kty, crv, x), Ed25519, true, [verify, verify])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(kty, crv, x), Ed25519, true, [verify, verify])": { "status": "FAIL" }, "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, true, [verify, verify])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (raw, buffer(32), Ed25519, true, [verify, verify])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, true, [sign])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), Ed25519, true, [sign])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign])": { "status": "FAIL" }, - "Good parameters with ignored JWK alg: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign])": { + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), Ed25519, true, [sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(crv, d, x, kty), Ed25519, true, [sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(crv, d, x, kty), Ed25519, true, [sign])": { "status": "FAIL" }, "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, true, [sign, sign])": { "status": "FAIL" }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), Ed25519, true, [sign, sign])": { + "status": "FAIL" + }, "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign, sign])": { "status": "FAIL" }, - "Good parameters with ignored JWK alg: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign, sign])": { + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), Ed25519, true, [sign, sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign, sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign, sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg Ed25519: Ed25519 (jwk, object(crv, d, x, kty), Ed25519, true, [sign, sign])": { + "status": "FAIL" + }, + "Good parameters with JWK alg EdDSA: Ed25519 (jwk, object(crv, d, x, kty), Ed25519, true, [sign, sign])": { "status": "FAIL" }, "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, [verify])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (spki, buffer(44), Ed25519, false, [verify])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, [verify])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), Ed25519, false, [verify])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, false, [verify])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (raw, buffer(32), Ed25519, false, [verify])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, [])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (spki, buffer(44), Ed25519, false, [])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, [])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), Ed25519, false, [])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, false, [])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (raw, buffer(32), Ed25519, false, [])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, [verify, verify])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (spki, buffer(44), Ed25519, false, [verify, verify])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, [verify, verify])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (jwk, object(kty, crv, x), Ed25519, false, [verify, verify])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (raw, buffer(32), {name: Ed25519}, false, [verify, verify])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (raw, buffer(32), Ed25519, false, [verify, verify])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, false, [sign])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), Ed25519, false, [sign])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, false, [sign])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), Ed25519, false, [sign])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, false, [sign, sign])": { "status": "PASS" }, + "Good parameters: Ed25519 bits (pkcs8, buffer(48), Ed25519, false, [sign, sign])": { + "status": "PASS" + }, "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, false, [sign, sign])": { "status": "PASS" + }, + "Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), Ed25519, false, [sign, sign])": { + "status": "PASS" } } \ No newline at end of file diff --git a/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json index 9d55c3be..b09ab922 100644 --- a/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json +++ b/tests/wpt-harness/expectations/WebCryptoAPI/import_export/okp_importKey_failures_Ed25519.https.any.js.json @@ -1,4 +1,994 @@ { + "Bad usages: importKey(spki, Ed25519, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(spki, Ed25519, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, true, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, Ed25519, false, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, true, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, Ed25519, false, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, Ed25519, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, true, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, Ed25519, false, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, verify])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, true, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), Ed25519, false, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, encrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, decrypt])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, sign])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, wrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, unwrapKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, deriveKey])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, true, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , Ed25519, false, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, "Bad usages: importKey(spki, {name: Ed25519}, true, [encrypt])": { "status": "PASS" }, @@ -125,6 +1115,78 @@ "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, deriveBits])": { "status": "PASS" }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, true, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(spki, {name: Ed25519}, false, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [encrypt])": { "status": "PASS" }, @@ -251,6 +1313,78 @@ "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, deriveBits])": { "status": "PASS" }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, true, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(pkcs8, {name: Ed25519}, false, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, "Bad usages: importKey(raw, {name: Ed25519}, true, [encrypt])": { "status": "PASS" }, @@ -362,20 +1496,92 @@ "Bad usages: importKey(raw, {name: Ed25519}, true, [deriveBits])": { "status": "PASS" }, - "Bad usages: importKey(raw, {name: Ed25519}, false, [deriveBits])": { - "status": "PASS" + "Bad usages: importKey(raw, {name: Ed25519}, false, [deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, deriveBits])": { + "status": "PASS" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(raw, {name: Ed25519}, false, [decapsulateBits])": { + "status": "FAIL" }, - "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, deriveBits])": { - "status": "PASS" + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, decapsulateBits])": { + "status": "FAIL" }, - "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, deriveBits])": { - "status": "PASS" + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, decapsulateBits])": { + "status": "FAIL" }, - "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, deriveBits])": { - "status": "PASS" + "Bad usages: importKey(raw, {name: Ed25519}, true, [verify, verify, decapsulateBits])": { + "status": "FAIL" }, - "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, deriveBits])": { - "status": "PASS" + "Bad usages: importKey(raw, {name: Ed25519}, false, [verify, verify, decapsulateBits])": { + "status": "FAIL" }, "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [encrypt])": { "status": "PASS" @@ -503,6 +1709,78 @@ "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, deriveBits])": { "status": "PASS" }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, true, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk(private), {name: Ed25519}, false, [sign, sign, decapsulateBits])": { + "status": "FAIL" + }, "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [encrypt])": { "status": "PASS" }, @@ -629,6 +1907,90 @@ "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, deriveBits])": { "status": "PASS" }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, encapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, encapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, decapsulateKey])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, true, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Bad usages: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify, decapsulateBits])": { + "status": "FAIL" + }, + "Empty usages: importKey(pkcs8, Ed25519, true, [])": { + "status": "PASS" + }, + "Empty usages: importKey(pkcs8, Ed25519, false, [])": { + "status": "PASS" + }, + "Empty usages: importKey(jwk(private), Ed25519, true, [])": { + "status": "PASS" + }, + "Empty usages: importKey(jwk(private), Ed25519, false, [])": { + "status": "PASS" + }, "Empty usages: importKey(pkcs8, {name: Ed25519}, true, [])": { "status": "PASS" }, @@ -641,6 +2003,66 @@ "Empty usages: importKey(jwk(private), {name: Ed25519}, false, [])": { "status": "PASS" }, + "Bad key length: importKey(spki, Ed25519, true, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(spki, Ed25519, false, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(spki, Ed25519, true, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(spki, Ed25519, false, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, Ed25519, true, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, Ed25519, false, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, Ed25519, true, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(pkcs8, Ed25519, false, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, Ed25519, true, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, Ed25519, false, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, Ed25519, true, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(raw, Ed25519, false, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), Ed25519, false, [sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), Ed25519, true, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk(private), Ed25519, false, [sign, sign])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , Ed25519, false, [verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , Ed25519, true, [verify, verify])": { + "status": "PASS" + }, + "Bad key length: importKey(jwk (public) , Ed25519, false, [verify, verify])": { + "status": "PASS" + }, "Bad key length: importKey(spki, {name: Ed25519}, true, [verify])": { "status": "PASS" }, @@ -701,6 +2123,42 @@ "Bad key length: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify])": { "status": "PASS" }, + "Missing JWK 'x' parameter: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Missing JWK 'x' parameter: importKey(jwk(private), Ed25519, false, [sign])": { + "status": "PASS" + }, + "Missing JWK 'x' parameter: importKey(jwk(private), Ed25519, true, [sign, sign])": { + "status": "PASS" + }, + "Missing JWK 'x' parameter: importKey(jwk(private), Ed25519, false, [sign, sign])": { + "status": "PASS" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "FAIL" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), Ed25519, false, [sign])": { + "status": "FAIL" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), Ed25519, true, [sign, sign])": { + "status": "FAIL" + }, + "Missing JWK 'kty' parameter: importKey(jwk(private), Ed25519, false, [sign, sign])": { + "status": "FAIL" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "PASS" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , Ed25519, false, [verify])": { + "status": "PASS" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , Ed25519, true, [verify, verify])": { + "status": "PASS" + }, + "Missing JWK 'crv' parameter: importKey(jwk (public) , Ed25519, false, [verify, verify])": { + "status": "PASS" + }, "Missing JWK 'x' parameter: importKey(jwk(private), {name: Ed25519}, true, [sign])": { "status": "PASS" }, @@ -737,10 +2195,118 @@ "Missing JWK 'crv' parameter: importKey(jwk (public) , {name: Ed25519}, false, [verify, verify])": { "status": "PASS" }, + "Invalid key pair: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Invalid key pair: importKey(jwk(private), Ed25519, true, [sign, sign])": { + "status": "PASS" + }, "Invalid key pair: importKey(jwk(private), {name: Ed25519}, true, [sign])": { "status": "PASS" }, "Invalid key pair: importKey(jwk(private), {name: Ed25519}, true, [sign, sign])": { "status": "PASS" + }, + "Missing algorithm name: importKey(spki, {}, true, verify)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(spki, {}, false, verify)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(pkcs8, {}, true, sign)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(pkcs8, {}, false, sign)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(raw, {}, true, verify)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(raw, {}, false, verify)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(jwk(private), {}, true, sign)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(jwk(private), {}, false, sign)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(jwk (public) , {}, true, verify)": { + "status": "PASS" + }, + "Missing algorithm name: importKey(jwk (public) , {}, false, verify)": { + "status": "PASS" + }, + "Invalid 'kty' field: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Invalid 'kty' field: importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "PASS" + }, + "Invalid 'kty' field: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Invalid 'kty' field: importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "PASS" + }, + "Import from a non-extractable: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Import from a non-extractable: importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "FAIL" + }, + "Import from a non-extractable: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Import from a non-extractable: importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'use' field: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Invalid 'use' field: importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'use' field: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Invalid 'use' field: importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'crv' field: importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Invalid 'crv' field: importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'crv' field: importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Invalid 'crv' field: importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'alg' field 'ed25519': importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Invalid 'alg' field 'ED25519': importKey(jwk(private), Ed25519, true, [sign])": { + "status": "PASS" + }, + "Invalid 'alg' field 'ed25519': importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'alg' field 'ED25519': importKey(jwk (public) , Ed25519, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'alg' field 'ed25519': importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Invalid 'alg' field 'ED25519': importKey(jwk(private), {name: Ed25519}, true, [sign])": { + "status": "PASS" + }, + "Invalid 'alg' field 'ed25519': importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "FAIL" + }, + "Invalid 'alg' field 'ED25519': importKey(jwk (public) , {name: Ed25519}, true, [verify])": { + "status": "FAIL" } } \ No newline at end of file diff --git a/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json b/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json index 42c4847c..1e1cbbf0 100644 --- a/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json +++ b/tests/wpt-harness/expectations/WebCryptoAPI/sign_verify/eddsa_curve25519.https.any.js.json @@ -2,12 +2,30 @@ "EdDSA Ed25519 verification": { "status": "PASS" }, + "EdDSA Ed25519 verification with altered signature during call": { + "status": "PASS" + }, "EdDSA Ed25519 verification with altered signature after call": { "status": "PASS" }, + "EdDSA Ed25519 verification with transferred signature during call": { + "status": "FAIL" + }, + "EdDSA Ed25519 verification with transferred signature after call": { + "status": "PASS" + }, + "EdDSA Ed25519 with altered data during call": { + "status": "PASS" + }, "EdDSA Ed25519 with altered data after call": { "status": "PASS" }, + "EdDSA Ed25519 with transferred data during call": { + "status": "FAIL" + }, + "EdDSA Ed25519 with transferred data after call": { + "status": "PASS" + }, "EdDSA Ed25519 using privateKey to verify": { "status": "PASS" },