OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ssl_platform_key.h" | |
6 | |
7 #include <keyhi.h> | 5 #include <keyhi.h> |
8 #include <openssl/bn.h> | 6 #include <openssl/bn.h> |
9 #include <openssl/ecdsa.h> | 7 #include <openssl/ecdsa.h> |
10 #include <openssl/rsa.h> | 8 #include <openssl/rsa.h> |
11 #include <pk11pub.h> | 9 #include <pk11pub.h> |
12 #include <prerror.h> | 10 #include <prerror.h> |
| 11 |
13 #include <utility> | 12 #include <utility> |
14 | 13 |
15 #include "base/logging.h" | 14 #include "base/logging.h" |
16 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" |
17 #include "base/sequenced_task_runner.h" | 17 #include "base/sequenced_task_runner.h" |
18 #include "crypto/scoped_nss_types.h" | 18 #include "crypto/scoped_nss_types.h" |
19 #include "crypto/scoped_openssl_types.h" | 19 #include "crypto/scoped_openssl_types.h" |
20 #include "net/cert/x509_certificate.h" | 20 #include "net/cert/x509_certificate.h" |
21 #include "net/ssl/client_key_store.h" | 21 #include "net/ssl/client_key_store.h" |
| 22 #include "net/ssl/ssl_platform_key.h" |
22 #include "net/ssl/ssl_platform_key_task_runner.h" | 23 #include "net/ssl/ssl_platform_key_task_runner.h" |
23 #include "net/ssl/ssl_private_key.h" | 24 #include "net/ssl/ssl_private_key.h" |
24 #include "net/ssl/threaded_ssl_private_key.h" | 25 #include "net/ssl/threaded_ssl_private_key.h" |
25 | 26 |
26 namespace net { | 27 namespace net { |
27 | 28 |
28 namespace { | 29 namespace { |
29 | 30 |
30 void LogPRError() { | 31 void LogPRError() { |
31 PRErrorCode err = PR_GetError(); | 32 PRErrorCode err = PR_GetError(); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 type = SSLPrivateKey::Type::RSA; | 176 type = SSLPrivateKey::Type::RSA; |
176 break; | 177 break; |
177 case ecKey: | 178 case ecKey: |
178 type = SSLPrivateKey::Type::ECDSA; | 179 type = SSLPrivateKey::Type::ECDSA; |
179 break; | 180 break; |
180 default: | 181 default: |
181 LOG(ERROR) << "Unknown key type: " << nss_type; | 182 LOG(ERROR) << "Unknown key type: " << nss_type; |
182 return nullptr; | 183 return nullptr; |
183 } | 184 } |
184 return make_scoped_refptr(new ThreadedSSLPrivateKey( | 185 return make_scoped_refptr(new ThreadedSSLPrivateKey( |
185 make_scoped_ptr(new SSLPlatformKeyNSS(type, std::move(key))), | 186 base::WrapUnique(new SSLPlatformKeyNSS(type, std::move(key))), |
186 GetSSLPlatformKeyTaskRunner())); | 187 GetSSLPlatformKeyTaskRunner())); |
187 } | 188 } |
188 | 189 |
189 } // namespace net | 190 } // namespace net |
OLD | NEW |