| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "crypto/ec_private_key.h" | 5 #include "crypto/ec_private_key.h" |
| 6 | 6 |
| 7 #include <openssl/ec.h> | |
| 8 #include <openssl/evp.h> | |
| 9 #include <openssl/pkcs12.h> | |
| 10 #include <openssl/x509.h> | |
| 11 | |
| 12 #include "base/logging.h" | 7 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 14 #include "crypto/openssl_util.h" | 9 #include "crypto/openssl_util.h" |
| 15 #include "crypto/scoped_openssl_types.h" | 10 #include "crypto/scoped_openssl_types.h" |
| 11 #include "third_party/boringssl/src/include/openssl/ec_key.h" |
| 12 #include "third_party/boringssl/src/include/openssl/evp.h" |
| 13 #include "third_party/boringssl/src/include/openssl/obj.h" |
| 14 #include "third_party/boringssl/src/include/openssl/pkcs12.h" |
| 15 #include "third_party/boringssl/src/include/openssl/x509.h" |
| 16 | 16 |
| 17 namespace crypto { | 17 namespace crypto { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Function pointer definition, for injecting the required key export function | 21 // Function pointer definition, for injecting the required key export function |
| 22 // into ExportKeyWithBio, below. |bio| is a temporary memory BIO object, and | 22 // into ExportKeyWithBio, below. |bio| is a temporary memory BIO object, and |
| 23 // |key| is a handle to the input key object. Return 1 on success, 0 otherwise. | 23 // |key| is a handle to the input key object. Return 1 on success, 0 otherwise. |
| 24 // NOTE: Used with OpenSSL functions, which do not comply with the Chromium | 24 // NOTE: Used with OpenSSL functions, which do not comply with the Chromium |
| 25 // style guide, hence the unusual parameter placement / types. | 25 // style guide, hence the unusual parameter placement / types. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 OpenSSLErrStackTracer err_tracer(FROM_HERE); | 227 OpenSSLErrStackTracer err_tracer(FROM_HERE); |
| 228 ScopedEC_KEY ec_key(EVP_PKEY_get1_EC_KEY(key_)); | 228 ScopedEC_KEY ec_key(EVP_PKEY_get1_EC_KEY(key_)); |
| 229 return ExportKey(ec_key.get(), | 229 return ExportKey(ec_key.get(), |
| 230 reinterpret_cast<ExportDataFunction>(i2d_ECParameters), | 230 reinterpret_cast<ExportDataFunction>(i2d_ECParameters), |
| 231 output); | 231 output); |
| 232 } | 232 } |
| 233 | 233 |
| 234 ECPrivateKey::ECPrivateKey() : key_(NULL) {} | 234 ECPrivateKey::ECPrivateKey() : key_(NULL) {} |
| 235 | 235 |
| 236 } // namespace crypto | 236 } // namespace crypto |
| OLD | NEW |