OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |