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

Side by Side Diff: net/cert/nss_cert_database.cc

Issue 424523002: Enable system NSS key slot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation of profile_io_data on !OS_CHROMEOS. Created 6 years, 4 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_cert_database.h ('k') | net/cert/nss_cert_database_chromeos.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cert/nss_cert_database.h" 5 #include "net/cert/nss_cert_database.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <certdb.h> 8 #include <certdb.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <pk11pub.h> 10 #include <pk11pub.h>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // base::Passed will NULL out |certs|, so cache the underlying pointer here. 123 // base::Passed will NULL out |certs|, so cache the underlying pointer here.
124 CertificateList* raw_certs = certs.get(); 124 CertificateList* raw_certs = certs.get();
125 GetSlowTaskRunner()->PostTaskAndReply( 125 GetSlowTaskRunner()->PostTaskAndReply(
126 FROM_HERE, 126 FROM_HERE,
127 base::Bind(&NSSCertDatabase::ListCertsImpl, 127 base::Bind(&NSSCertDatabase::ListCertsImpl,
128 base::Passed(crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot))), 128 base::Passed(crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot))),
129 base::Unretained(raw_certs)), 129 base::Unretained(raw_certs)),
130 base::Bind(callback, base::Passed(&certs))); 130 base::Bind(callback, base::Passed(&certs)));
131 } 131 }
132 132
133 #if defined(OS_CHROMEOS)
134 crypto::ScopedPK11Slot NSSCertDatabase::GetSystemSlot() const {
135 return crypto::ScopedPK11Slot();
136 }
137 #endif
138
133 crypto::ScopedPK11Slot NSSCertDatabase::GetPublicSlot() const { 139 crypto::ScopedPK11Slot NSSCertDatabase::GetPublicSlot() const {
134 return crypto::ScopedPK11Slot(PK11_ReferenceSlot(public_slot_.get())); 140 return crypto::ScopedPK11Slot(PK11_ReferenceSlot(public_slot_.get()));
135 } 141 }
136 142
137 crypto::ScopedPK11Slot NSSCertDatabase::GetPrivateSlot() const { 143 crypto::ScopedPK11Slot NSSCertDatabase::GetPrivateSlot() const {
138 return crypto::ScopedPK11Slot(PK11_ReferenceSlot(private_slot_.get())); 144 return crypto::ScopedPK11Slot(PK11_ReferenceSlot(private_slot_.get()));
139 } 145 }
140 146
141 CryptoModule* NSSCertDatabase::GetPublicModule() const { 147 CryptoModule* NSSCertDatabase::GetPublicModule() const {
142 crypto::ScopedPK11Slot slot(GetPublicSlot()); 148 crypto::ScopedPK11Slot slot(GetPublicSlot());
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 } else { 469 } else {
464 if (SEC_DeletePermCertificate(cert->os_cert_handle())) { 470 if (SEC_DeletePermCertificate(cert->os_cert_handle())) {
465 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError(); 471 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError();
466 return false; 472 return false;
467 } 473 }
468 } 474 }
469 return true; 475 return true;
470 } 476 }
471 477
472 } // namespace net 478 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/nss_cert_database.h ('k') | net/cert/nss_cert_database_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698