Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: net/ssl/test_ssl_private_key.cc

Issue 2898573002: Refactor client cert private key handling. (Closed)
Patch Set: removed no longer needed forward declaration Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/ssl/test_ssl_private_key.h ('k') | net/test/url_request/url_request_mock_data_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "crypto/rsa_private_key.h"
12 #include "net/base/net_errors.h" 13 #include "net/base/net_errors.h"
13 #include "net/ssl/ssl_platform_key_util.h" 14 #include "net/ssl/ssl_platform_key_util.h"
14 #include "net/ssl/ssl_private_key.h" 15 #include "net/ssl/ssl_private_key.h"
15 #include "net/ssl/threaded_ssl_private_key.h" 16 #include "net/ssl/threaded_ssl_private_key.h"
16 #include "third_party/boringssl/src/include/openssl/digest.h" 17 #include "third_party/boringssl/src/include/openssl/digest.h"
17 #include "third_party/boringssl/src/include/openssl/ec.h" 18 #include "third_party/boringssl/src/include/openssl/ec.h"
18 #include "third_party/boringssl/src/include/openssl/evp.h" 19 #include "third_party/boringssl/src/include/openssl/evp.h"
19 #include "third_party/boringssl/src/include/openssl/rsa.h" 20 #include "third_party/boringssl/src/include/openssl/rsa.h"
20 21
21 namespace net { 22 namespace net {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey( 102 scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey(
102 bssl::UniquePtr<EVP_PKEY> key) { 103 bssl::UniquePtr<EVP_PKEY> key) {
103 if (!key) 104 if (!key)
104 return nullptr; 105 return nullptr;
105 106
106 return make_scoped_refptr(new ThreadedSSLPrivateKey( 107 return make_scoped_refptr(new ThreadedSSLPrivateKey(
107 base::MakeUnique<TestSSLPlatformKey>(std::move(key)), 108 base::MakeUnique<TestSSLPlatformKey>(std::move(key)),
108 GetSSLPlatformKeyTaskRunner())); 109 GetSSLPlatformKeyTaskRunner()));
109 } 110 }
110 111
112 scoped_refptr<SSLPrivateKey> WrapRSAPrivateKey(
113 crypto::RSAPrivateKey* rsa_private_key) {
114 EVP_PKEY_up_ref(rsa_private_key->key());
115 return net::WrapOpenSSLPrivateKey(
116 bssl::UniquePtr<EVP_PKEY>(rsa_private_key->key()));
117 }
118
111 } // namespace net 119 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/test_ssl_private_key.h ('k') | net/test/url_request/url_request_mock_data_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698