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 "net/ssl/openssl_platform_key.h" | 5 #include "net/ssl/openssl_platform_key.h" |
6 | 6 |
7 #include <openssl/err.h> | 7 #include <openssl/err.h> |
8 #include <openssl/evp.h> | 8 #include <openssl/evp.h> |
9 #include <openssl/rsa.h> | 9 #include <openssl/rsa.h> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 }; | 100 }; |
101 | 101 |
102 // ExDataDup is called when one of the RSA or EC_KEY objects is | 102 // ExDataDup is called when one of the RSA or EC_KEY objects is |
103 // duplicated. This is not supported and should never happen. | 103 // duplicated. This is not supported and should never happen. |
104 int ExDataDup(CRYPTO_EX_DATA* to, | 104 int ExDataDup(CRYPTO_EX_DATA* to, |
105 const CRYPTO_EX_DATA* from, | 105 const CRYPTO_EX_DATA* from, |
106 void** from_d, | 106 void** from_d, |
107 int idx, | 107 int idx, |
108 long argl, | 108 long argl, |
109 void* argp) { | 109 void* argp) { |
110 CHECK(false); | 110 CHECK_EQ((void*)NULL, *from_d); |
111 return 0; | 111 return 0; |
112 } | 112 } |
113 | 113 |
114 // ExDataFree is called when one of the RSA or EC_KEY objects is freed. | 114 // ExDataFree is called when one of the RSA or EC_KEY objects is freed. |
115 void ExDataFree(void* parent, | 115 void ExDataFree(void* parent, |
116 void* ptr, | 116 void* ptr, |
117 CRYPTO_EX_DATA* ex_data, | 117 CRYPTO_EX_DATA* ex_data, |
118 int idx, | 118 int idx, |
119 long argl, void* argp) { | 119 long argl, void* argp) { |
120 KeyExData* data = reinterpret_cast<KeyExData*>(ptr); | 120 KeyExData* data = reinterpret_cast<KeyExData*>(ptr); |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 base::ScopedCFTypeRef<SecKeyRef> private_key( | 454 base::ScopedCFTypeRef<SecKeyRef> private_key( |
455 FetchSecKeyRefForCertificate(certificate)); | 455 FetchSecKeyRefForCertificate(certificate)); |
456 if (!private_key) | 456 if (!private_key) |
457 return crypto::ScopedEVP_PKEY(); | 457 return crypto::ScopedEVP_PKEY(); |
458 | 458 |
459 // Create an EVP_PKEY wrapper. | 459 // Create an EVP_PKEY wrapper. |
460 return CreatePkeyWrapper(private_key.get()); | 460 return CreatePkeyWrapper(private_key.get()); |
461 } | 461 } |
462 | 462 |
463 } // namespace net | 463 } // namespace net |
OLD | NEW |