OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
8 | 8 |
9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 if (core->ssl_config_.send_client_cert) { | 1306 if (core->ssl_config_.send_client_cert) { |
1307 if (core->ssl_config_.client_cert) { | 1307 if (core->ssl_config_.client_cert) { |
1308 PCCERT_CONTEXT cert_context = | 1308 PCCERT_CONTEXT cert_context = |
1309 core->ssl_config_.client_cert->os_cert_handle(); | 1309 core->ssl_config_.client_cert->os_cert_handle(); |
1310 | 1310 |
1311 HCRYPTPROV_OR_NCRYPT_KEY_HANDLE crypt_prov = 0; | 1311 HCRYPTPROV_OR_NCRYPT_KEY_HANDLE crypt_prov = 0; |
1312 DWORD key_spec = 0; | 1312 DWORD key_spec = 0; |
1313 BOOL must_free = FALSE; | 1313 BOOL must_free = FALSE; |
1314 DWORD flags = 0; | 1314 DWORD flags = 0; |
1315 if (base::win::GetVersion() >= base::win::VERSION_VISTA) | 1315 if (base::win::GetVersion() >= base::win::VERSION_VISTA) |
1316 flags |= CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG; | 1316 flags |= CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG; |
1317 | 1317 |
1318 BOOL acquired_key = CryptAcquireCertificatePrivateKey( | 1318 BOOL acquired_key = CryptAcquireCertificatePrivateKey( |
1319 cert_context, flags, NULL, &crypt_prov, &key_spec, &must_free); | 1319 cert_context, flags, NULL, &crypt_prov, &key_spec, &must_free); |
1320 | 1320 |
1321 if (acquired_key) { | 1321 if (acquired_key) { |
1322 // Should never get a cached handle back - ownership must always be | 1322 // Should never get a cached handle back - ownership must always be |
1323 // transferred. | 1323 // transferred. |
1324 CHECK_EQ(must_free, TRUE); | 1324 CHECK_EQ(must_free, TRUE); |
1325 | 1325 |
1326 SECItem der_cert; | 1326 SECItem der_cert; |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3547 EnsureThreadIdAssigned(); | 3547 EnsureThreadIdAssigned(); |
3548 base::AutoLock auto_lock(lock_); | 3548 base::AutoLock auto_lock(lock_); |
3549 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 3549 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
3550 } | 3550 } |
3551 | 3551 |
3552 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3552 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
3553 return server_bound_cert_service_; | 3553 return server_bound_cert_service_; |
3554 } | 3554 } |
3555 | 3555 |
3556 } // namespace net | 3556 } // namespace net |
OLD | NEW |