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

Side by Side Diff: net/ssl/client_cert_store_chromeos.cc

Issue 330213002: *wip* NSS: handle chromeos system slot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: child of https://codereview.chromium.org/383593002/ now Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/cert/nss_profile_filter_chromeos_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/ssl/client_cert_store_chromeos.h" 5 #include "net/ssl/client_cert_store_chromeos.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "crypto/nss_crypto_module_delegate.h" 10 #include "crypto/nss_crypto_module_delegate.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DVLOG(1) << "filtered " << pre_size - selected_certs->size() << " of " 56 DVLOG(1) << "filtered " << pre_size - selected_certs->size() << " of "
57 << pre_size << " certs"; 57 << pre_size << " certs";
58 } 58 }
59 59
60 void ClientCertStoreChromeOS::DidGetPrivateSlot( 60 void ClientCertStoreChromeOS::DidGetPrivateSlot(
61 const SSLCertRequestInfo* request, 61 const SSLCertRequestInfo* request,
62 CertificateList* selected_certs, 62 CertificateList* selected_certs,
63 const base::Closure& callback, 63 const base::Closure& callback,
64 crypto::ScopedPK11Slot private_slot) { 64 crypto::ScopedPK11Slot private_slot) {
65 profile_filter_.Init(crypto::GetPublicSlotForChromeOSUser(username_hash_), 65 profile_filter_.Init(crypto::GetPublicSlotForChromeOSUser(username_hash_),
66 private_slot.Pass()); 66 private_slot.Pass(),
67 crypto::ScopedPK11Slot(crypto::GetSystemNSSKeySlot()));
67 ClientCertStoreNSS::GetClientCerts(*request, selected_certs, callback); 68 ClientCertStoreNSS::GetClientCerts(*request, selected_certs, callback);
68 } 69 }
69 70
70 void ClientCertStoreChromeOS::InitForTesting( 71 void ClientCertStoreChromeOS::InitForTesting(
71 crypto::ScopedPK11Slot public_slot, 72 crypto::ScopedPK11Slot public_slot,
72 crypto::ScopedPK11Slot private_slot) { 73 crypto::ScopedPK11Slot private_slot) {
73 profile_filter_.Init(public_slot.Pass(), private_slot.Pass()); 74 profile_filter_.Init(public_slot.Pass(),
75 private_slot.Pass(),
76 // XXX pass system slot? add unittests with system slot?
77 crypto::ScopedPK11Slot());
74 } 78 }
75 79
76 bool ClientCertStoreChromeOS::SelectClientCertsForTesting( 80 bool ClientCertStoreChromeOS::SelectClientCertsForTesting(
77 const CertificateList& input_certs, 81 const CertificateList& input_certs,
78 const SSLCertRequestInfo& request, 82 const SSLCertRequestInfo& request,
79 CertificateList* selected_certs) { 83 CertificateList* selected_certs) {
80 CERTCertList* cert_list = CERT_NewCertList(); 84 CERTCertList* cert_list = CERT_NewCertList();
81 if (!cert_list) 85 if (!cert_list)
82 return false; 86 return false;
83 for (size_t i = 0; i < input_certs.size(); ++i) { 87 for (size_t i = 0; i < input_certs.size(); ++i) {
84 CERT_AddCertToListTail( 88 CERT_AddCertToListTail(
85 cert_list, CERT_DupCertificate(input_certs[i]->os_cert_handle())); 89 cert_list, CERT_DupCertificate(input_certs[i]->os_cert_handle()));
86 } 90 }
87 91
88 GetClientCertsImpl(cert_list, request, false, selected_certs); 92 GetClientCertsImpl(cert_list, request, false, selected_certs);
89 CERT_DestroyCertList(cert_list); 93 CERT_DestroyCertList(cert_list);
90 return true; 94 return true;
91 } 95 }
92 96
93 97
94 } // namespace net 98 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/nss_profile_filter_chromeos_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698