| 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 "components/webcrypto/algorithms/test_helpers.h" | 5 #include "components/webcrypto/algorithms/test_helpers.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base64url.h" | 9 #include "base/base64url.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "components/test_runner/test_common.h" | 18 #include "components/test_runner/test_common.h" |
| 19 #include "components/webcrypto/algorithm_dispatch.h" | 19 #include "components/webcrypto/algorithm_dispatch.h" |
| 20 #include "components/webcrypto/crypto_data.h" | 20 #include "components/webcrypto/crypto_data.h" |
| 21 #include "components/webcrypto/generate_key_result.h" | 21 #include "components/webcrypto/generate_key_result.h" |
| 22 #include "components/webcrypto/jwk.h" | 22 #include "components/webcrypto/jwk.h" |
| 23 #include "components/webcrypto/status.h" | 23 #include "components/webcrypto/status.h" |
| 24 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 24 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| 25 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 25 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
| 26 #include "third_party/re2/re2/re2.h" | 26 #include "third_party/re2/src/re2/re2.h" |
| 27 | 27 |
| 28 namespace webcrypto { | 28 namespace webcrypto { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 bool Base64DecodeUrlSafe(const std::string& input, std::string* output) { | 32 bool Base64DecodeUrlSafe(const std::string& input, std::string* output) { |
| 33 // The JSON web signature spec says that padding is omitted. | 33 // The JSON web signature spec says that padding is omitted. |
| 34 // https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-36#section-2 | 34 // https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-36#section-2 |
| 35 return base::Base64UrlDecode( | 35 return base::Base64UrlDecode( |
| 36 input, base::Base64UrlDecodePolicy::DISALLOW_PADDING, output); | 36 input, base::Base64UrlDecodePolicy::DISALLOW_PADDING, output); |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 } | 686 } |
| 687 | 687 |
| 688 blink::WebCryptoAlgorithm CreateEcImportAlgorithm( | 688 blink::WebCryptoAlgorithm CreateEcImportAlgorithm( |
| 689 blink::WebCryptoAlgorithmId id, | 689 blink::WebCryptoAlgorithmId id, |
| 690 blink::WebCryptoNamedCurve named_curve) { | 690 blink::WebCryptoNamedCurve named_curve) { |
| 691 return blink::WebCryptoAlgorithm::adoptParamsAndCreate( | 691 return blink::WebCryptoAlgorithm::adoptParamsAndCreate( |
| 692 id, new blink::WebCryptoEcKeyImportParams(named_curve)); | 692 id, new blink::WebCryptoEcKeyImportParams(named_curve)); |
| 693 } | 693 } |
| 694 | 694 |
| 695 } // namespace webcrypto | 695 } // namespace webcrypto |
| OLD | NEW |