| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/platform_keys/platform_keys.h" | 5 #include "chrome/browser/chromeos/platform_keys/platform_keys.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <cryptohi.h> | 8 #include <cryptohi.h> |
| 9 #include <keyhi.h> | 9 #include <keyhi.h> |
| 10 #include <secder.h> | 10 #include <secder.h> |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 void SelectClientCertificates(const ClientCertificateRequest& request, | 749 void SelectClientCertificates(const ClientCertificateRequest& request, |
| 750 const SelectCertificatesCallback& callback, | 750 const SelectCertificatesCallback& callback, |
| 751 content::BrowserContext* browser_context) { | 751 content::BrowserContext* browser_context) { |
| 752 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 752 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 753 | 753 |
| 754 scoped_refptr<net::SSLCertRequestInfo> cert_request_info( | 754 scoped_refptr<net::SSLCertRequestInfo> cert_request_info( |
| 755 new net::SSLCertRequestInfo); | 755 new net::SSLCertRequestInfo); |
| 756 cert_request_info->cert_key_types = request.certificate_key_types; | 756 cert_request_info->cert_key_types = request.certificate_key_types; |
| 757 cert_request_info->cert_authorities = request.certificate_authorities; | 757 cert_request_info->cert_authorities = request.certificate_authorities; |
| 758 | 758 |
| 759 user_manager::User* user = chromeos::ProfileHelper::Get()->GetUserByProfile( | 759 const user_manager::User* user = |
| 760 Profile::FromBrowserContext(browser_context)); | 760 chromeos::ProfileHelper::Get()->GetUserByProfile( |
| 761 Profile::FromBrowserContext(browser_context)); |
| 761 | 762 |
| 762 // Use the device-wide system key slot only if the user is of the same | 763 // Use the device-wide system key slot only if the user is of the same |
| 763 // domain as the device is registered to. | 764 // domain as the device is registered to. |
| 764 policy::BrowserPolicyConnectorChromeOS* connector = | 765 policy::BrowserPolicyConnectorChromeOS* connector = |
| 765 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 766 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 766 bool use_system_key_slot = connector->GetUserAffiliation(user->email()) == | 767 bool use_system_key_slot = connector->GetUserAffiliation(user->email()) == |
| 767 policy::USER_AFFILIATION_MANAGED; | 768 policy::USER_AFFILIATION_MANAGED; |
| 768 | 769 |
| 769 scoped_ptr<SelectCertificatesState> state(new SelectCertificatesState( | 770 scoped_ptr<SelectCertificatesState> state(new SelectCertificatesState( |
| 770 user->username_hash(), use_system_key_slot, cert_request_info, callback)); | 771 user->username_hash(), use_system_key_slot, cert_request_info, callback)); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 NSSOperationState* state_ptr = state.get(); | 875 NSSOperationState* state_ptr = state.get(); |
| 875 GetCertDatabase(std::string() /* don't get any specific slot */, | 876 GetCertDatabase(std::string() /* don't get any specific slot */, |
| 876 base::Bind(&GetTokensWithDB, base::Passed(&state)), | 877 base::Bind(&GetTokensWithDB, base::Passed(&state)), |
| 877 browser_context, | 878 browser_context, |
| 878 state_ptr); | 879 state_ptr); |
| 879 } | 880 } |
| 880 | 881 |
| 881 } // namespace platform_keys | 882 } // namespace platform_keys |
| 882 | 883 |
| 883 } // namespace chromeos | 884 } // namespace chromeos |
| OLD | NEW |