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

Side by Side Diff: chromeos/cert_loader.cc

Issue 556243003: Make the private slot optional in NSSCertDatabase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | net/cert/nss_cert_database.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 "chromeos/cert_loader.h" 5 #include "chromeos/cert_loader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void CertLoader::RemoveObserver(CertLoader::Observer* observer) { 83 void CertLoader::RemoveObserver(CertLoader::Observer* observer) {
84 observers_.RemoveObserver(observer); 84 observers_.RemoveObserver(observer);
85 } 85 }
86 86
87 bool CertLoader::IsHardwareBacked() const { 87 bool CertLoader::IsHardwareBacked() const {
88 if (force_hardware_backed_for_test_) 88 if (force_hardware_backed_for_test_)
89 return true; 89 return true;
90 if (!database_) 90 if (!database_)
91 return false; 91 return false;
92 crypto::ScopedPK11Slot slot(database_->GetPrivateSlot()); 92 crypto::ScopedPK11Slot slot(database_->GetPrivateSlot());
93 DCHECK(slot); 93 if (!slot)
94 return false;
94 return PK11_IsHW(slot.get()); 95 return PK11_IsHW(slot.get());
95 } 96 }
96 97
97 bool CertLoader::IsCertificateHardwareBacked( 98 bool CertLoader::IsCertificateHardwareBacked(
98 const net::X509Certificate* cert) const { 99 const net::X509Certificate* cert) const {
99 if (!database_) 100 if (!database_)
100 return false; 101 return false;
101 return database_->IsHardwareBacked(cert); 102 return database_->IsHardwareBacked(cert);
102 } 103 }
103 104
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 VLOG(1) << "OnCertAdded"; 190 VLOG(1) << "OnCertAdded";
190 LoadCertificates(); 191 LoadCertificates();
191 } 192 }
192 193
193 void CertLoader::OnCertRemoved(const net::X509Certificate* cert) { 194 void CertLoader::OnCertRemoved(const net::X509Certificate* cert) {
194 VLOG(1) << "OnCertRemoved"; 195 VLOG(1) << "OnCertRemoved";
195 LoadCertificates(); 196 LoadCertificates();
196 } 197 }
197 198
198 } // namespace chromeos 199 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | net/cert/nss_cert_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698