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/ec.h" | 5 #include "components/webcrypto/algorithms/ec.h" |
6 | 6 |
7 #include <openssl/bn.h> | |
8 #include <openssl/bytestring.h> | |
9 #include <openssl/ec.h> | |
10 #include <openssl/ec_key.h> | |
11 #include <openssl/evp.h> | |
12 #include <openssl/mem.h> | |
13 #include <stddef.h> | 7 #include <stddef.h> |
14 #include <utility> | 8 #include <utility> |
15 | 9 |
16 #include "base/logging.h" | 10 #include "base/logging.h" |
17 #include "base/macros.h" | 11 #include "base/macros.h" |
18 #include "components/webcrypto/algorithms/asymmetric_key_util.h" | 12 #include "components/webcrypto/algorithms/asymmetric_key_util.h" |
19 #include "components/webcrypto/algorithms/util.h" | 13 #include "components/webcrypto/algorithms/util.h" |
20 #include "components/webcrypto/blink_key_handle.h" | 14 #include "components/webcrypto/blink_key_handle.h" |
21 #include "components/webcrypto/crypto_data.h" | 15 #include "components/webcrypto/crypto_data.h" |
22 #include "components/webcrypto/generate_key_result.h" | 16 #include "components/webcrypto/generate_key_result.h" |
23 #include "components/webcrypto/jwk.h" | 17 #include "components/webcrypto/jwk.h" |
24 #include "components/webcrypto/status.h" | 18 #include "components/webcrypto/status.h" |
25 #include "crypto/openssl_util.h" | 19 #include "crypto/openssl_util.h" |
26 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 20 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
27 #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/bytestring.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/evp.h" |
| 27 #include "third_party/boringssl/src/include/openssl/mem.h" |
28 | 28 |
29 namespace webcrypto { | 29 namespace webcrypto { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 // Maps a blink::WebCryptoNamedCurve to the corresponding NID used by | 33 // Maps a blink::WebCryptoNamedCurve to the corresponding NID used by |
34 // BoringSSL. | 34 // BoringSSL. |
35 Status WebCryptoCurveToNid(blink::WebCryptoNamedCurve named_curve, int* nid) { | 35 Status WebCryptoCurveToNid(blink::WebCryptoNamedCurve named_curve, int* nid) { |
36 switch (named_curve) { | 36 switch (named_curve) { |
37 case blink::WebCryptoNamedCurveP256: | 37 case blink::WebCryptoNamedCurveP256: |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 | 688 |
689 if (algorithm.ecParams()->namedCurve() != | 689 if (algorithm.ecParams()->namedCurve() != |
690 key->algorithm().ecParams()->namedCurve()) { | 690 key->algorithm().ecParams()->namedCurve()) { |
691 return Status::ErrorUnexpected(); | 691 return Status::ErrorUnexpected(); |
692 } | 692 } |
693 | 693 |
694 return Status::Success(); | 694 return Status::Success(); |
695 } | 695 } |
696 | 696 |
697 } // namespace webcrypto | 697 } // namespace webcrypto |
OLD | NEW |