OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test_ssl_private_key.h" | 5 #include "net/ssl/test_ssl_private_key.h" |
6 | 6 |
7 #include <openssl/digest.h> | 7 #include <openssl/digest.h> |
8 #include <openssl/evp.h> | 8 #include <openssl/evp.h> |
| 9 |
9 #include <utility> | 10 #include <utility> |
10 | 11 |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" |
13 #include "crypto/scoped_openssl_types.h" | 15 #include "crypto/scoped_openssl_types.h" |
14 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
15 #include "net/ssl/ssl_platform_key_task_runner.h" | 17 #include "net/ssl/ssl_platform_key_task_runner.h" |
16 #include "net/ssl/ssl_private_key.h" | 18 #include "net/ssl/ssl_private_key.h" |
17 #include "net/ssl/threaded_ssl_private_key.h" | 19 #include "net/ssl/threaded_ssl_private_key.h" |
18 | 20 |
19 namespace net { | 21 namespace net { |
20 | 22 |
21 namespace { | 23 namespace { |
22 | 24 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 type = SSLPrivateKey::Type::RSA; | 116 type = SSLPrivateKey::Type::RSA; |
115 break; | 117 break; |
116 case EVP_PKEY_EC: | 118 case EVP_PKEY_EC: |
117 type = SSLPrivateKey::Type::ECDSA; | 119 type = SSLPrivateKey::Type::ECDSA; |
118 break; | 120 break; |
119 default: | 121 default: |
120 LOG(ERROR) << "Unknown key type: " << EVP_PKEY_id(key.get()); | 122 LOG(ERROR) << "Unknown key type: " << EVP_PKEY_id(key.get()); |
121 return nullptr; | 123 return nullptr; |
122 } | 124 } |
123 return make_scoped_refptr(new ThreadedSSLPrivateKey( | 125 return make_scoped_refptr(new ThreadedSSLPrivateKey( |
124 make_scoped_ptr(new TestSSLPlatformKey(std::move(key), type)), | 126 base::WrapUnique(new TestSSLPlatformKey(std::move(key), type)), |
125 GetSSLPlatformKeyTaskRunner())); | 127 GetSSLPlatformKeyTaskRunner())); |
126 } | 128 } |
127 | 129 |
128 } // namespace net | 130 } // namespace net |
OLD | NEW |