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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/net/client_cert_store_chromeos.cc
diff --git a/chrome/browser/chromeos/net/client_cert_store_chromeos.cc b/chrome/browser/chromeos/net/client_cert_store_chromeos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..03fc90a3b0593230abfaee2af7cd313320cc574c
--- /dev/null
+++ b/chrome/browser/chromeos/net/client_cert_store_chromeos.cc
@@ -0,0 +1,55 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/net/client_cert_store_chromeos.h"
+
+#include "base/bind.h"
+#include "content/public/browser/nss_context.h"
+
+namespace chromeos {
+
+ClientCertStoreChromeOS::ClientCertStoreChromeOS(
+ content::ResourceContext* context)
+ : context_(context) {}
+
+ClientCertStoreChromeOS::~ClientCertStoreChromeOS() {}
+
+void ClientCertStoreChromeOS::GetClientCerts(
+ const net::SSLCertRequestInfo& cert_request_info,
+ net::CertificateList* selected_certs,
+ const base::Closure& callback) {
+ cert_request_info_ = &cert_request_info;
+ selected_certs_ = selected_certs;
+ callback_ = callback;
+
+ content::OnNSSKeySlotsForResourceContextReady(
+ context_,
+ base::Bind(&ClientCertStoreChromeOS::DidGetSlots,
+ base::Unretained(this)));
+}
+
+void ClientCertStoreChromeOS::DidGetSlots(crypto::ScopedPK11Slot public_slot,
+ crypto::ScopedPK11Slot private_slot) {
+ VLOG(1) << __func__;
+ profile_filter_.Init(public_slot.Pass(), private_slot.Pass());
+ net_client_cert_store_impl_.GetClientCerts(
+ *cert_request_info_, selected_certs_,
+ base::Bind(&ClientCertStoreChromeOS::GotClientCerts,
+ base::Unretained(this)));
+}
+
+void ClientCertStoreChromeOS::GotClientCerts(){
+ size_t pre_size = selected_certs_->size();
+ selected_certs_->erase(
+ std::remove_if(selected_certs_->begin(),
+ selected_certs_->end(),
+ net::NSSProfileFilterChromeOS::Predicate(profile_filter_)),
+ selected_certs_->end());
+ VLOG(1) << "filtered " << pre_size - selected_certs_->size() << " of "
+ << pre_size << " certs";
+
+ callback_.Run();
+}
+
+} // namespace chromeos
« 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