X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fmodules%2Fcrypto%2FKey.cpp;h=f15c557fd5f97d1cd76b128390fcb528c77cafc8;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=c3b3fb3045e62bba2bf625053868477e913af338;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/modules/crypto/Key.cpp b/src/third_party/WebKit/Source/modules/crypto/Key.cpp index c3b3fb3..f15c557 100644 --- a/src/third_party/WebKit/Source/modules/crypto/Key.cpp +++ b/src/third_party/WebKit/Source/modules/crypto/Key.cpp @@ -69,11 +69,12 @@ const KeyUsageMapping keyUsageMappings[] = { { blink::WebCryptoKeyUsageSign, "sign" }, { blink::WebCryptoKeyUsageVerify, "verify" }, { blink::WebCryptoKeyUsageDeriveKey, "deriveKey" }, + { blink::WebCryptoKeyUsageDeriveBits, "deriveBits" }, { blink::WebCryptoKeyUsageWrapKey, "wrapKey" }, { blink::WebCryptoKeyUsageUnwrapKey, "unwrapKey" }, }; -COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 6) + 1, update_keyUsageMappings); +COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 7) + 1, update_keyUsageMappings); const char* keyUsageToString(blink::WebCryptoKeyUsage usage) { @@ -107,6 +108,8 @@ blink::WebCryptoKeyUsageMask toKeyUsage(AlgorithmOperation operation) return blink::WebCryptoKeyUsageVerify; case DeriveKey: return blink::WebCryptoKeyUsageDeriveKey; + case DeriveBits: + return blink::WebCryptoKeyUsageDeriveBits; case WrapKey: return blink::WebCryptoKeyUsageWrapKey; case UnwrapKey: @@ -168,12 +171,12 @@ Vector 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 +203,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 +213,7 @@ bool Key::parseUsageMask(const Vector& 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;