| 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/openssl/ec_algorithm_openssl.h" | 5 #include "components/webcrypto/openssl/ec_algorithm_openssl.h" |
| 6 | 6 |
| 7 #include <openssl/ec.h> | 7 #include <openssl/ec.h> |
| 8 #include <openssl/ec_key.h> | 8 #include <openssl/ec_key.h> |
| 9 #include <openssl/evp.h> | 9 #include <openssl/evp.h> |
| 10 #include <openssl/pkcs12.h> | 10 #include <openssl/pkcs12.h> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "content/child/webcrypto/crypto_data.h" | 14 #include "components/webcrypto/crypto_data.h" |
| 15 #include "content/child/webcrypto/generate_key_result.h" | 15 #include "components/webcrypto/generate_key_result.h" |
| 16 #include "content/child/webcrypto/jwk.h" | 16 #include "components/webcrypto/jwk.h" |
| 17 #include "content/child/webcrypto/openssl/key_openssl.h" | 17 #include "components/webcrypto/openssl/key_openssl.h" |
| 18 #include "content/child/webcrypto/openssl/util_openssl.h" | 18 #include "components/webcrypto/openssl/util_openssl.h" |
| 19 #include "content/child/webcrypto/status.h" | 19 #include "components/webcrypto/status.h" |
| 20 #include "content/child/webcrypto/webcrypto_util.h" | 20 #include "components/webcrypto/webcrypto_util.h" |
| 21 #include "crypto/openssl_util.h" | 21 #include "crypto/openssl_util.h" |
| 22 #include "crypto/scoped_openssl_types.h" | 22 #include "crypto/scoped_openssl_types.h" |
| 23 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 23 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| 24 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 24 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
| 25 | 25 |
| 26 namespace content { | |
| 27 | |
| 28 namespace webcrypto { | 26 namespace webcrypto { |
| 29 | 27 |
| 30 namespace { | 28 namespace { |
| 31 | 29 |
| 32 // Maps a blink::WebCryptoNamedCurve to the corresponding NID used by | 30 // Maps a blink::WebCryptoNamedCurve to the corresponding NID used by |
| 33 // BoringSSL. | 31 // BoringSSL. |
| 34 Status WebCryptoCurveToNid(blink::WebCryptoNamedCurve named_curve, int* nid) { | 32 Status WebCryptoCurveToNid(blink::WebCryptoNamedCurve named_curve, int* nid) { |
| 35 switch (named_curve) { | 33 switch (named_curve) { |
| 36 case blink::WebCryptoNamedCurveP256: | 34 case blink::WebCryptoNamedCurveP256: |
| 37 *nid = NID_X9_62_prime256v1; | 35 *nid = NID_X9_62_prime256v1; |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 | 557 |
| 560 if (algorithm.ecParams()->namedCurve() != | 558 if (algorithm.ecParams()->namedCurve() != |
| 561 key->algorithm().ecParams()->namedCurve()) { | 559 key->algorithm().ecParams()->namedCurve()) { |
| 562 return Status::ErrorUnexpected(); | 560 return Status::ErrorUnexpected(); |
| 563 } | 561 } |
| 564 | 562 |
| 565 return Status::Success(); | 563 return Status::Success(); |
| 566 } | 564 } |
| 567 | 565 |
| 568 } // namespace webcrypto | 566 } // namespace webcrypto |
| 569 | |
| 570 } // namespace content | |
| OLD | NEW |