| Index: third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
|
| diff --git a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
|
| index 88e674fc4526774d16eccf5ecad692404fea8bc4..98fbadd81cfbf73e1063099454cef7f617b19828 100644
|
| --- a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
|
| +++ b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
|
| @@ -58,25 +58,6 @@ static bool ParseAlgorithm(const AlgorithmIdentifier& raw,
|
| return success;
|
| }
|
|
|
| -static bool CanAccessWebCrypto(ScriptState* script_state,
|
| - CryptoResult* result) {
|
| - String error_message;
|
| - if (!ExecutionContext::From(script_state)
|
| - ->IsSecureContext(error_message,
|
| - ExecutionContext::kWebCryptoSecureContextCheck)) {
|
| - result->CompleteWithError(kWebCryptoErrorTypeNotSupported, error_message);
|
| - return false;
|
| - }
|
| -
|
| - if (!ExecutionContext::From(script_state)->IsSecureContext()) {
|
| - Deprecation::CountDeprecation(
|
| - ExecutionContext::From(script_state),
|
| - UseCounter::kSubtleCryptoOnlyStrictSecureContextCheckFailed);
|
| - }
|
| -
|
| - return true;
|
| -}
|
| -
|
| static bool CopyStringProperty(const char* property,
|
| const Dictionary& source,
|
| JSONObject* destination) {
|
| @@ -190,9 +171,6 @@ ScriptPromise SubtleCrypto::encrypt(ScriptState* script_state,
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| // 14.3.1.2: Let data be the result of getting a copy of the bytes held by
|
| // the data parameter passed to the encrypt method.
|
| WebVector<uint8_t> data = CopyBytes(raw_data);
|
| @@ -231,9 +209,6 @@ ScriptPromise SubtleCrypto::decrypt(ScriptState* script_state,
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| // 14.3.2.2: Let data be the result of getting a copy of the bytes held by
|
| // the data parameter passed to the decrypt method.
|
| WebVector<uint8_t> data = CopyBytes(raw_data);
|
| @@ -272,9 +247,6 @@ ScriptPromise SubtleCrypto::sign(ScriptState* script_state,
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| // 14.3.3.2: Let data be the result of getting a copy of the bytes held by
|
| // the data parameter passed to the sign method.
|
| WebVector<uint8_t> data = CopyBytes(raw_data);
|
| @@ -315,9 +287,6 @@ ScriptPromise SubtleCrypto::verifySignature(
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| // 14.3.4.2: Let signature be the result of getting a copy of the bytes
|
| // held by the signature parameter passed to the verify method.
|
| WebVector<uint8_t> signature = CopyBytes(raw_signature);
|
| @@ -360,9 +329,6 @@ ScriptPromise SubtleCrypto::digest(ScriptState* script_state,
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| // 14.3.5.2: Let data be the result of getting a copy of the bytes held
|
| // by the data parameter passed to the digest method.
|
| WebVector<uint8_t> data = CopyBytes(raw_data);
|
| @@ -392,9 +358,6 @@ ScriptPromise SubtleCrypto::generateKey(
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| WebCryptoKeyUsageMask key_usages;
|
| if (!CryptoKey::ParseUsageMask(raw_key_usages, key_usages, result))
|
| return promise;
|
| @@ -431,9 +394,6 @@ ScriptPromise SubtleCrypto::importKey(
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| WebCryptoKeyFormat format;
|
| if (!CryptoKey::ParseFormat(raw_format, format, result))
|
| return promise;
|
| @@ -515,9 +475,6 @@ ScriptPromise SubtleCrypto::exportKey(ScriptState* script_state,
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| WebCryptoKeyFormat format;
|
| if (!CryptoKey::ParseFormat(raw_format, format, result))
|
| return promise;
|
| @@ -548,9 +505,6 @@ ScriptPromise SubtleCrypto::wrapKey(
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| WebCryptoKeyFormat format;
|
| if (!CryptoKey::ParseFormat(raw_format, format, result))
|
| return promise;
|
| @@ -613,9 +567,6 @@ ScriptPromise SubtleCrypto::unwrapKey(
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| WebCryptoKeyFormat format;
|
| if (!CryptoKey::ParseFormat(raw_format, format, result))
|
| return promise;
|
| @@ -685,9 +636,6 @@ ScriptPromise SubtleCrypto::deriveBits(ScriptState* script_state,
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| // 14.3.8.2: Let normalizedAlgorithm be the result of normalizing an
|
| // algorithm, with alg set to algorithm and op set to
|
| // "deriveBits".
|
| @@ -726,9 +674,6 @@ ScriptPromise SubtleCrypto::deriveKey(
|
| CryptoResultImpl* result = CryptoResultImpl::Create(script_state);
|
| ScriptPromise promise = result->Promise();
|
|
|
| - if (!CanAccessWebCrypto(script_state, result))
|
| - return promise;
|
| -
|
| WebCryptoKeyUsageMask key_usages;
|
| if (!CryptoKey::ParseUsageMask(raw_key_usages, key_usages, result))
|
| return promise;
|
|
|