OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/child/webcrypto/algorithm_dispatch.h" | 5 #include "components/webcrypto/algorithm_dispatch.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/child/webcrypto/algorithm_implementation.h" | 8 #include "components/webcrypto/algorithm_implementation.h" |
9 #include "content/child/webcrypto/algorithm_registry.h" | 9 #include "components/webcrypto/algorithm_registry.h" |
10 #include "content/child/webcrypto/crypto_data.h" | 10 #include "components/webcrypto/crypto_data.h" |
11 #include "content/child/webcrypto/generate_key_result.h" | 11 #include "components/webcrypto/generate_key_result.h" |
12 #include "content/child/webcrypto/platform_crypto.h" | 12 #include "components/webcrypto/platform_crypto.h" |
13 #include "content/child/webcrypto/status.h" | 13 #include "components/webcrypto/status.h" |
14 #include "content/child/webcrypto/webcrypto_util.h" | 14 #include "components/webcrypto/webcrypto_util.h" |
15 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 15 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
16 | 16 |
17 namespace content { | |
18 | |
19 namespace webcrypto { | 17 namespace webcrypto { |
20 | 18 |
21 namespace { | 19 namespace { |
22 | 20 |
23 Status DecryptDontCheckKeyUsage(const blink::WebCryptoAlgorithm& algorithm, | 21 Status DecryptDontCheckKeyUsage(const blink::WebCryptoAlgorithm& algorithm, |
24 const blink::WebCryptoKey& key, | 22 const blink::WebCryptoKey& key, |
25 const CryptoData& data, | 23 const CryptoData& data, |
26 std::vector<uint8_t>* buffer) { | 24 std::vector<uint8_t>* buffer) { |
27 if (algorithm.id() != key.algorithm().id()) | 25 if (algorithm.id() != key.algorithm().id()) |
28 return Status::ErrorUnexpected(); | 26 return Status::ErrorUnexpected(); |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 Status status = GetAlgorithmImplementation(algorithm.id(), &impl); | 334 Status status = GetAlgorithmImplementation(algorithm.id(), &impl); |
337 if (status.IsError()) | 335 if (status.IsError()) |
338 return false; | 336 return false; |
339 | 337 |
340 status = impl->DeserializeKeyForClone(algorithm, type, extractable, usages, | 338 status = impl->DeserializeKeyForClone(algorithm, type, extractable, usages, |
341 key_data, key); | 339 key_data, key); |
342 return status.IsSuccess(); | 340 return status.IsSuccess(); |
343 } | 341 } |
344 | 342 |
345 } // namespace webcrypto | 343 } // namespace webcrypto |
346 | |
347 } // namespace content | |
OLD | NEW |