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

Side by Side Diff: net/ssl/ssl_platform_key_win.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_nss.cc ('k') | net/ssl/ssl_private_key_test_util.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 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" 5 #include "net/ssl/ssl_platform_key.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <NCrypt.h> 8 #include <NCrypt.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 NCRYPT_KEY_HANDLE key_; 241 NCRYPT_KEY_HANDLE key_;
242 SSLPrivateKey::Type type_; 242 SSLPrivateKey::Type type_;
243 size_t max_length_; 243 size_t max_length_;
244 244
245 DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyCNG); 245 DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyCNG);
246 }; 246 };
247 247
248 } // namespace 248 } // namespace
249 249
250 scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey( 250 scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey(
251 X509Certificate* certificate) { 251 const X509Certificate* certificate) {
252 // Rather than query the private key for metadata, extract the public key from 252 // Rather than query the private key for metadata, extract the public key from
253 // the certificate without using Windows APIs. CAPI and CNG do not 253 // the certificate without using Windows APIs. CAPI and CNG do not
254 // consistently work depending on the system. See https://crbug.com/468345. 254 // consistently work depending on the system. See https://crbug.com/468345.
255 SSLPrivateKey::Type key_type; 255 SSLPrivateKey::Type key_type;
256 size_t max_length; 256 size_t max_length;
257 if (!GetClientCertInfo(certificate, &key_type, &max_length)) 257 if (!GetClientCertInfo(certificate, &key_type, &max_length))
258 return nullptr; 258 return nullptr;
259 259
260 PCCERT_CONTEXT cert_context = certificate->os_cert_handle(); 260 PCCERT_CONTEXT cert_context = certificate->os_cert_handle();
261 261
(...skipping 17 matching lines...) Expand all
279 delegate.reset(new SSLPlatformKeyCNG(prov_or_key, key_type, max_length)); 279 delegate.reset(new SSLPlatformKeyCNG(prov_or_key, key_type, max_length));
280 } else { 280 } else {
281 DCHECK(SSLPrivateKey::Type::RSA == key_type); 281 DCHECK(SSLPrivateKey::Type::RSA == key_type);
282 delegate.reset(new SSLPlatformKeyCAPI(prov_or_key, key_spec, max_length)); 282 delegate.reset(new SSLPlatformKeyCAPI(prov_or_key, key_spec, max_length));
283 } 283 }
284 return make_scoped_refptr(new ThreadedSSLPrivateKey( 284 return make_scoped_refptr(new ThreadedSSLPrivateKey(
285 std::move(delegate), GetSSLPlatformKeyTaskRunner())); 285 std::move(delegate), GetSSLPlatformKeyTaskRunner()));
286 } 286 }
287 287
288 } // namespace net 288 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_platform_key_nss.cc ('k') | net/ssl/ssl_private_key_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698