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 <openssl/bn.h> | |
6 #include <openssl/digest.h> | |
7 #include <openssl/ec.h> | |
8 #include <openssl/ec_key.h> | |
9 #include <openssl/ecdsa.h> | |
10 #include <openssl/evp.h> | |
11 #include <openssl/mem.h> | |
12 #include <stddef.h> | 5 #include <stddef.h> |
13 #include <stdint.h> | 6 #include <stdint.h> |
14 | 7 |
15 #include "base/logging.h" | 8 #include "base/logging.h" |
16 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
17 #include "components/webcrypto/algorithm_implementation.h" | 10 #include "components/webcrypto/algorithm_implementation.h" |
18 #include "components/webcrypto/algorithms/ec.h" | 11 #include "components/webcrypto/algorithms/ec.h" |
19 #include "components/webcrypto/algorithms/util.h" | 12 #include "components/webcrypto/algorithms/util.h" |
20 #include "components/webcrypto/blink_key_handle.h" | 13 #include "components/webcrypto/blink_key_handle.h" |
21 #include "components/webcrypto/crypto_data.h" | 14 #include "components/webcrypto/crypto_data.h" |
22 #include "components/webcrypto/generate_key_result.h" | 15 #include "components/webcrypto/generate_key_result.h" |
23 #include "components/webcrypto/status.h" | 16 #include "components/webcrypto/status.h" |
24 #include "crypto/openssl_util.h" | 17 #include "crypto/openssl_util.h" |
25 #include "crypto/secure_util.h" | 18 #include "crypto/secure_util.h" |
26 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 19 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
27 #include "third_party/WebKit/public/platform/WebCryptoKey.h" | 20 #include "third_party/WebKit/public/platform/WebCryptoKey.h" |
28 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 21 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
| 22 #include "third_party/boringssl/src/include/openssl/bn.h" |
| 23 #include "third_party/boringssl/src/include/openssl/digest.h" |
| 24 #include "third_party/boringssl/src/include/openssl/ec.h" |
| 25 #include "third_party/boringssl/src/include/openssl/ec_key.h" |
| 26 #include "third_party/boringssl/src/include/openssl/ecdsa.h" |
| 27 #include "third_party/boringssl/src/include/openssl/evp.h" |
| 28 #include "third_party/boringssl/src/include/openssl/mem.h" |
29 | 29 |
30 namespace webcrypto { | 30 namespace webcrypto { |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 // Extracts the OpenSSL key and digest from a WebCrypto key + algorithm. The | 34 // Extracts the OpenSSL key and digest from a WebCrypto key + algorithm. The |
35 // returned pkey pointer will remain valid as long as |key| is alive. | 35 // returned pkey pointer will remain valid as long as |key| is alive. |
36 Status GetPKeyAndDigest(const blink::WebCryptoAlgorithm& algorithm, | 36 Status GetPKeyAndDigest(const blink::WebCryptoAlgorithm& algorithm, |
37 const blink::WebCryptoKey& key, | 37 const blink::WebCryptoKey& key, |
38 EVP_PKEY** pkey, | 38 EVP_PKEY** pkey, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 252 } |
253 }; | 253 }; |
254 | 254 |
255 } // namespace | 255 } // namespace |
256 | 256 |
257 std::unique_ptr<AlgorithmImplementation> CreateEcdsaImplementation() { | 257 std::unique_ptr<AlgorithmImplementation> CreateEcdsaImplementation() { |
258 return base::WrapUnique(new EcdsaImplementation); | 258 return base::WrapUnique(new EcdsaImplementation); |
259 } | 259 } |
260 | 260 |
261 } // namespace webcrypto | 261 } // namespace webcrypto |
OLD | NEW |