forked from mirrors/gecko-dev
Bug 1894027 - Replacing SyntaxError exception with TypeError for derive_bits_keys r=nss-reviewers,jschanck
Differential Revision: https://phabricator.services.mozilla.com/D208914
This commit is contained in:
parent
2859e9cc30
commit
33701c7ba8
3 changed files with 10 additions and 76 deletions
|
|
@ -166,7 +166,7 @@ static nsresult Coerce(JSContext* aCx, T& aTarget, const OOS& aAlgorithm) {
|
||||||
|
|
||||||
JS::Rooted<JS::Value> value(aCx, JS::ObjectValue(*aAlgorithm.GetAsObject()));
|
JS::Rooted<JS::Value> value(aCx, JS::ObjectValue(*aAlgorithm.GetAsObject()));
|
||||||
if (!aTarget.Init(aCx, value)) {
|
if (!aTarget.Init(aCx, value)) {
|
||||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
return NS_ERROR_DOM_TYPE_MISMATCH_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
@ -392,9 +392,14 @@ void WebCryptoTask::FailWithError(nsresult aRv) {
|
||||||
MOZ_ASSERT(IsOnOriginalThread());
|
MOZ_ASSERT(IsOnOriginalThread());
|
||||||
Telemetry::Accumulate(Telemetry::WEBCRYPTO_RESOLVED, false);
|
Telemetry::Accumulate(Telemetry::WEBCRYPTO_RESOLVED, false);
|
||||||
|
|
||||||
|
if (aRv == NS_ERROR_DOM_TYPE_MISMATCH_ERR) {
|
||||||
|
mResultPromise->MaybeRejectWithTypeError(
|
||||||
|
"The operation could not be performed.");
|
||||||
|
} else {
|
||||||
// Blindly convert nsresult to DOMException
|
// Blindly convert nsresult to DOMException
|
||||||
// Individual tasks must ensure they pass the right values
|
// Individual tasks must ensure they pass the right values
|
||||||
mResultPromise->MaybeReject(aRv);
|
mResultPromise->MaybeReject(aRv);
|
||||||
|
}
|
||||||
// Manually release mResultPromise while we're on the main thread
|
// Manually release mResultPromise while we're on the main thread
|
||||||
mResultPromise = nullptr;
|
mResultPromise = nullptr;
|
||||||
mWorkerRef = nullptr;
|
mWorkerRef = nullptr;
|
||||||
|
|
@ -2750,7 +2755,7 @@ class DeriveEcdhBitsTask : public ReturnArrayBufferViewTask {
|
||||||
RootedDictionary<EcdhKeyDeriveParams> params(aCx);
|
RootedDictionary<EcdhKeyDeriveParams> params(aCx);
|
||||||
mEarlyRv = Coerce(aCx, params, aAlgorithm);
|
mEarlyRv = Coerce(aCx, params, aAlgorithm);
|
||||||
if (NS_FAILED(mEarlyRv)) {
|
if (NS_FAILED(mEarlyRv)) {
|
||||||
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
|
/* The returned code is installed by Coerce function. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,24 +19,6 @@
|
||||||
[P-384 non-multiple of 8 bits]
|
[P-384 non-multiple of 8 bits]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[P-521 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-521 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-521 asking for too many bits]
|
[P-521 asking for too many bits]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
@ -68,24 +50,6 @@
|
||||||
[P-384 non-multiple of 8 bits]
|
[P-384 non-multiple of 8 bits]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[P-521 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-521 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-521 asking for too many bits]
|
[P-521 asking for too many bits]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,7 @@
|
||||||
[ecdh_keys.https.any.html]
|
[ecdh_keys.https.any.html]
|
||||||
expected:
|
expected:
|
||||||
if (os == "android") and fission: [OK, TIMEOUT]
|
if (os == "android") and fission: [OK, TIMEOUT]
|
||||||
[P-521 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-521 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[ecdh_keys.https.any.worker.html]
|
[ecdh_keys.https.any.worker.html]
|
||||||
expected:
|
expected:
|
||||||
if (os == "android") and fission: [OK, TIMEOUT]
|
if (os == "android") and fission: [OK, TIMEOUT]
|
||||||
[P-521 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 missing public curve]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-521 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-256 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[P-384 public property of algorithm is not a CryptoKey]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue