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

Side by Side Diff: chrome/browser/chromeos/platform_keys/platform_keys_nss.cc

Issue 1274143002: ClientCertStoreChromeOS: support additional non-platform certs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored to suggested pulling of certificates. Created 5 years, 4 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
OLDNEW
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>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/bind_helpers.h" 13 #include "base/bind_helpers.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/location.h" 16 #include "base/location.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/single_thread_task_runner.h" 19 #include "base/single_thread_task_runner.h"
20 #include "base/stl_util.h" 20 #include "base/stl_util.h"
21 #include "base/thread_task_runner_handle.h" 21 #include "base/thread_task_runner_handle.h"
22 #include "base/threading/worker_pool.h" 22 #include "base/threading/worker_pool.h"
23 #include "chrome/browser/browser_process.h" 23 #include "chrome/browser/browser_process.h"
24 #include "chrome/browser/browser_process_platform_part_chromeos.h" 24 #include "chrome/browser/browser_process_platform_part_chromeos.h"
25 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h"
25 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h" 26 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h"
26 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h" 27 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h"
27 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 28 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
28 #include "chrome/browser/chromeos/profiles/profile_helper.h" 29 #include "chrome/browser/chromeos/profiles/profile_helper.h"
29 #include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_plat form_keys_api.h" 30 #include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_plat form_keys_api.h"
30 #include "chrome/browser/net/nss_context.h" 31 #include "chrome/browser/net/nss_context.h"
31 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
32 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 33 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
33 #include "content/public/browser/browser_context.h" 34 #include "content/public/browser/browser_context.h"
34 #include "content/public/browser/browser_thread.h" 35 #include "content/public/browser/browser_thread.h"
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 DCHECK_CURRENTLY_ON(BrowserThread::IO); 545 DCHECK_CURRENTLY_ON(BrowserThread::IO);
545 state->CallBack(FROM_HERE, state->certs_.Pass(), 546 state->CallBack(FROM_HERE, state->certs_.Pass(),
546 std::string() /* no error */); 547 std::string() /* no error */);
547 } 548 }
548 549
549 // Continues selecting certificates on the IO thread. Used by 550 // Continues selecting certificates on the IO thread. Used by
550 // SelectClientCertificates(). 551 // SelectClientCertificates().
551 void SelectCertificatesOnIOThread(scoped_ptr<SelectCertificatesState> state) { 552 void SelectCertificatesOnIOThread(scoped_ptr<SelectCertificatesState> state) {
552 DCHECK_CURRENTLY_ON(BrowserThread::IO); 553 DCHECK_CURRENTLY_ON(BrowserThread::IO);
553 state->cert_store_.reset(new chromeos::ClientCertStoreChromeOS( 554 state->cert_store_.reset(new chromeos::ClientCertStoreChromeOS(
555 nullptr, // no additional certs
davidben 2015/08/14 21:49:16 "No additional provider." perhaps?
pneubeck (no reviews) 2015/08/17 12:01:32 Done.
554 make_scoped_ptr(new chromeos::ClientCertFilterChromeOS( 556 make_scoped_ptr(new chromeos::ClientCertFilterChromeOS(
555 state->use_system_key_slot_, state->username_hash_)), 557 state->use_system_key_slot_, state->username_hash_)),
556 chromeos::ClientCertStoreChromeOS::PasswordDelegateFactory())); 558 chromeos::ClientCertStoreChromeOS::PasswordDelegateFactory()));
557 559
558 state->certs_.reset(new net::CertificateList); 560 state->certs_.reset(new net::CertificateList);
559 561
560 SelectCertificatesState* state_ptr = state.get(); 562 SelectCertificatesState* state_ptr = state.get();
561 state_ptr->cert_store_->GetClientCerts( 563 state_ptr->cert_store_->GetClientCerts(
562 *state_ptr->cert_request_info_, state_ptr->certs_.get(), 564 *state_ptr->cert_request_info_, state_ptr->certs_.get(),
563 base::Bind(&DidSelectCertificatesOnIOThread, base::Passed(&state))); 565 base::Bind(&DidSelectCertificatesOnIOThread, base::Passed(&state)));
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 NSSOperationState* state_ptr = state.get(); 895 NSSOperationState* state_ptr = state.get();
894 GetCertDatabase(std::string() /* don't get any specific slot */, 896 GetCertDatabase(std::string() /* don't get any specific slot */,
895 base::Bind(&GetTokensWithDB, base::Passed(&state)), 897 base::Bind(&GetTokensWithDB, base::Passed(&state)),
896 browser_context, 898 browser_context,
897 state_ptr); 899 state_ptr);
898 } 900 }
899 901
900 } // namespace platform_keys 902 } // namespace platform_keys
901 903
902 } // namespace chromeos 904 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698