Index: Source/modules/crypto/Key.cpp |
diff --git a/Source/modules/crypto/Key.cpp b/Source/modules/crypto/Key.cpp |
index c3b3fb3045e62bba2bf625053868477e913af338..6f029a47741386dceda13de2125daba96e48fdf4 100644 |
--- a/Source/modules/crypto/Key.cpp |
+++ b/Source/modules/crypto/Key.cpp |
@@ -168,12 +168,12 @@ Vector<String> Key::usages() const |
bool Key::canBeUsedForAlgorithm(const blink::WebCryptoAlgorithm& algorithm, AlgorithmOperation op, CryptoResult* result) const |
{ |
if (!(m_key.usages() & toKeyUsage(op))) { |
- result->completeWithError("key.usages does not permit this operation"); |
+ result->completeWithError(blink::WebCryptoErrorTypeInvalidAccess, "key.usages does not permit this operation"); |
return false; |
} |
if (m_key.algorithm().id() != algorithm.id()) { |
- result->completeWithError("key.algorithm does not match that of operation"); |
+ result->completeWithError(blink::WebCryptoErrorTypeInvalidAccess, "key.algorithm does not match that of operation"); |
return false; |
} |
@@ -200,7 +200,7 @@ bool Key::parseFormat(const String& formatString, blink::WebCryptoKeyFormat& for |
return true; |
} |
- result->completeWithError("Invalid keyFormat argument"); |
+ result->completeWithError(blink::WebCryptoErrorTypeSyntax, "Invalid keyFormat argument"); |
return false; |
} |
@@ -210,7 +210,7 @@ bool Key::parseUsageMask(const Vector<String>& usages, blink::WebCryptoKeyUsageM |
for (size_t i = 0; i < usages.size(); ++i) { |
blink::WebCryptoKeyUsageMask usage = keyUsageStringToMask(usages[i]); |
if (!usage) { |
- result->completeWithError("Invalid keyUsages argument"); |
+ result->completeWithError(blink::WebCryptoErrorTypeSyntax, "Invalid keyUsages argument"); |
return false; |
} |
mask |= usage; |