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

Unified Diff: net/cert/nss_cert_database.cc

Issue 214863002: Extension API enterprise.platformKeys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enabled restriction to extensions force-installed by policy. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/cert/nss_cert_database.cc
diff --git a/net/cert/nss_cert_database.cc b/net/cert/nss_cert_database.cc
index ed861b200bfeb207ee1fa6ff2fe75a9a72bb429c..fdd6ce60a464e533d4a1d2258776b46b06cf0893 100644
--- a/net/cert/nss_cert_database.cc
+++ b/net/cert/nss_cert_database.cc
@@ -82,7 +82,7 @@ void NSSCertDatabase::ListCerts(
const base::Callback<void(scoped_ptr<CertificateList> certs)>& callback) {
scoped_ptr<CertificateList> certs(new CertificateList());
- // base::Pased will NULL out |certs|, so cache the underlying pointer here.
+ // base::Passed will NULL out |certs|, so cache the underlying pointer here.
CertificateList* raw_certs = certs.get();
GetSlowTaskRunner()->PostTaskAndReply(
FROM_HERE,
@@ -91,6 +91,21 @@ void NSSCertDatabase::ListCerts(
base::Bind(callback, base::Passed(&certs)));
}
+void NSSCertDatabase::ListCertsInSlot(const ListCertsCallback& callback,
+ PK11SlotInfo* slot) {
+ DCHECK(slot);
+ scoped_ptr<CertificateList> certs(new CertificateList());
+
+ // base::Passed will NULL out |certs|, so cache the underlying pointer here.
+ CertificateList* raw_certs = certs.get();
+ GetSlowTaskRunner()->PostTaskAndReply(
+ FROM_HERE,
+ base::Bind(&NSSCertDatabase::ListCertsInSlotImpl,
+ base::Passed(crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot))),
+ base::Unretained(raw_certs)),
+ base::Bind(callback, base::Passed(&certs)));
+}
+
crypto::ScopedPK11Slot NSSCertDatabase::GetPublicSlot() const {
return crypto::ScopedPK11Slot(crypto::GetPublicNSSKeySlot());
}
@@ -362,6 +377,20 @@ void NSSCertDatabase::SetSlowTaskRunnerForTest(
}
// static
+void NSSCertDatabase::ListCertsInSlotImpl(crypto::ScopedPK11Slot slot,
+ CertificateList* certs) {
mattm 2014/05/16 20:27:12 certs->clear();
pneubeck (no reviews) 2014/05/19 19:17:19 Merged with other ListCertsImpl. Done.
+ DCHECK(slot);
+ CERTCertList* cert_list = PK11_ListCertsInSlot(slot.get());
+ CERTCertListNode* node;
+ for (node = CERT_LIST_HEAD(cert_list); !CERT_LIST_END(node, cert_list);
+ node = CERT_LIST_NEXT(node)) {
+ certs->push_back(X509Certificate::CreateFromHandle(
+ node->cert, X509Certificate::OSCertHandles()));
+ }
+ CERT_DestroyCertList(cert_list);
+}
+
+// static
void NSSCertDatabase::ListCertsImpl(CertificateList* certs) {
certs->clear();

Powered by Google App Engine
This is Rietveld 408576698