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

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

Issue 383593002: Add GetSystemNSSKeySlot, merge GetPrivateNSSKeySlot/GetPublicNSSKeySlot to GetPersistentNSSKeySlot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changes for comment #5 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/base/keygen_handler_nss.cc ('k') | net/socket/ssl_server_socket_nss.cc » ('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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 CertificateList* raw_certs = certs.get(); 103 CertificateList* raw_certs = certs.get();
104 GetSlowTaskRunner()->PostTaskAndReply( 104 GetSlowTaskRunner()->PostTaskAndReply(
105 FROM_HERE, 105 FROM_HERE,
106 base::Bind(&NSSCertDatabase::ListCertsImpl, 106 base::Bind(&NSSCertDatabase::ListCertsImpl,
107 base::Passed(crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot))), 107 base::Passed(crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot))),
108 base::Unretained(raw_certs)), 108 base::Unretained(raw_certs)),
109 base::Bind(callback, base::Passed(&certs))); 109 base::Bind(callback, base::Passed(&certs)));
110 } 110 }
111 111
112 crypto::ScopedPK11Slot NSSCertDatabase::GetPublicSlot() const { 112 crypto::ScopedPK11Slot NSSCertDatabase::GetPublicSlot() const {
113 return crypto::ScopedPK11Slot(crypto::GetPublicNSSKeySlot()); 113 return crypto::ScopedPK11Slot(crypto::GetPersistentNSSKeySlot());
114 } 114 }
115 115
116 crypto::ScopedPK11Slot NSSCertDatabase::GetPrivateSlot() const { 116 crypto::ScopedPK11Slot NSSCertDatabase::GetPrivateSlot() const {
117 return crypto::ScopedPK11Slot(crypto::GetPrivateNSSKeySlot()); 117 return crypto::ScopedPK11Slot(crypto::GetPersistentNSSKeySlot());
118 } 118 }
119 119
120 CryptoModule* NSSCertDatabase::GetPublicModule() const { 120 CryptoModule* NSSCertDatabase::GetPublicModule() const {
121 crypto::ScopedPK11Slot slot(GetPublicSlot()); 121 crypto::ScopedPK11Slot slot(GetPublicSlot());
122 return CryptoModule::CreateFromHandle(slot.get()); 122 return CryptoModule::CreateFromHandle(slot.get());
123 } 123 }
124 124
125 CryptoModule* NSSCertDatabase::GetPrivateModule() const { 125 CryptoModule* NSSCertDatabase::GetPrivateModule() const {
126 crypto::ScopedPK11Slot slot(GetPrivateSlot()); 126 crypto::ScopedPK11Slot slot(GetPrivateSlot());
127 return CryptoModule::CreateFromHandle(slot.get()); 127 return CryptoModule::CreateFromHandle(slot.get());
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } else { 442 } else {
443 if (SEC_DeletePermCertificate(cert->os_cert_handle())) { 443 if (SEC_DeletePermCertificate(cert->os_cert_handle())) {
444 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError(); 444 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError();
445 return false; 445 return false;
446 } 446 }
447 } 447 }
448 return true; 448 return true;
449 } 449 }
450 450
451 } // namespace net 451 } // namespace net
OLDNEW
« no previous file with comments | « net/base/keygen_handler_nss.cc ('k') | net/socket/ssl_server_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698