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

Side by Side Diff: chrome/browser/chromeos/net/client_cert_store_chromeos.cc

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: certdb: handle GetCertTrust and IsUntrusted, failed attempt to handle SetCertTrust Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h"
6
7 #include "base/bind.h"
8 #include "content/public/browser/nss_context.h"
9
10 namespace chromeos {
11
12 ClientCertStoreChromeOS::ClientCertStoreChromeOS(
13 content::ResourceContext* context)
14 : context_(context) {}
15
16 ClientCertStoreChromeOS::~ClientCertStoreChromeOS() {}
17
18 void ClientCertStoreChromeOS::GetClientCerts(
19 const net::SSLCertRequestInfo& cert_request_info,
20 net::CertificateList* selected_certs,
21 const base::Closure& callback) {
22 cert_request_info_ = &cert_request_info;
23 selected_certs_ = selected_certs;
24 callback_ = callback;
25
26 content::OnNSSKeySlotsForResourceContextReady(
27 context_,
28 base::Bind(&ClientCertStoreChromeOS::DidGetSlots,
29 base::Unretained(this)));
30 }
31
32 void ClientCertStoreChromeOS::DidGetSlots(crypto::ScopedPK11Slot public_slot,
33 crypto::ScopedPK11Slot private_slot) {
34 VLOG(1) << __func__;
35 profile_filter_.Init(public_slot.Pass(), private_slot.Pass());
36 net_client_cert_store_impl_.GetClientCerts(
37 *cert_request_info_, selected_certs_,
38 base::Bind(&ClientCertStoreChromeOS::GotClientCerts,
39 base::Unretained(this)));
40 }
41
42 void ClientCertStoreChromeOS::GotClientCerts(){
43 size_t pre_size = selected_certs_->size();
44 selected_certs_->erase(
45 std::remove_if(selected_certs_->begin(),
46 selected_certs_->end(),
47 net::NSSProfileFilterChromeOS::Predicate(profile_filter_)),
48 selected_certs_->end());
49 VLOG(1) << "filtered " << pre_size - selected_certs_->size() << " of "
50 << pre_size << " certs";
51
52 callback_.Run();
53 }
54
55 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/client_cert_store_chromeos.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698