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

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

Issue 2566273008: Use SecKeyCreateSignature on macOS 10.12 and later. (Closed)
Patch Set: rsleevi comments Created 4 years 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/ssl_platform_key_mac_unittest.cc ('k') | net/ssl/ssl_platform_key_win.cc » ('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 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 <cert.h> 5 #include <cert.h>
6 #include <keyhi.h> 6 #include <keyhi.h>
7 #include <pk11pub.h> 7 #include <pk11pub.h>
8 #include <prerror.h> 8 #include <prerror.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 SSLPrivateKey::Type type_; 152 SSLPrivateKey::Type type_;
153 size_t max_length_; 153 size_t max_length_;
154 crypto::ScopedSECKEYPrivateKey key_; 154 crypto::ScopedSECKEYPrivateKey key_;
155 155
156 DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyNSS); 156 DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyNSS);
157 }; 157 };
158 158
159 } // namespace 159 } // namespace
160 160
161 scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey( 161 scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey(
162 X509Certificate* certificate) { 162 const X509Certificate* certificate) {
163 crypto::ScopedSECKEYPrivateKey key( 163 crypto::ScopedSECKEYPrivateKey key(
164 PK11_FindKeyByAnyCert(certificate->os_cert_handle(), nullptr)); 164 PK11_FindKeyByAnyCert(certificate->os_cert_handle(), nullptr));
165 if (!key) { 165 if (!key) {
166 return ClientKeyStore::GetInstance()->FetchClientCertPrivateKey( 166 return ClientKeyStore::GetInstance()->FetchClientCertPrivateKey(
167 *certificate); 167 *certificate);
168 } 168 }
169 169
170 SSLPrivateKey::Type type; 170 SSLPrivateKey::Type type;
171 size_t max_length; 171 size_t max_length;
172 if (!GetClientCertInfo(certificate, &type, &max_length)) 172 if (!GetClientCertInfo(certificate, &type, &max_length))
173 return nullptr; 173 return nullptr;
174 174
175 return make_scoped_refptr(new ThreadedSSLPrivateKey( 175 return make_scoped_refptr(new ThreadedSSLPrivateKey(
176 base::MakeUnique<SSLPlatformKeyNSS>(type, max_length, std::move(key)), 176 base::MakeUnique<SSLPlatformKeyNSS>(type, max_length, std::move(key)),
177 GetSSLPlatformKeyTaskRunner())); 177 GetSSLPlatformKeyTaskRunner()));
178 } 178 }
179 179
180 } // namespace net 180 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_platform_key_mac_unittest.cc ('k') | net/ssl/ssl_platform_key_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698