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

Unified Diff: net/base/cert_database_nss.cc

Issue 5686002: NSS: PKCS 11 password prompt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing review comments Created 9 years, 11 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
« no previous file with comments | « net/base/cert_database.h ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_database_nss.cc
diff --git a/net/base/cert_database_nss.cc b/net/base/cert_database_nss.cc
index a32a7a3923c80578759b1c2ee73d02179bfbc6cc..db2c47ad0451e63080c7558a6b87771a99a64ff0 100644
--- a/net/base/cert_database_nss.cc
+++ b/net/base/cert_database_nss.cc
@@ -12,7 +12,9 @@
#include "base/logging.h"
#include "base/nss_util.h"
+#include "base/nss_util_internal.h"
#include "base/scoped_ptr.h"
+#include "net/base/crypto_module.h"
#include "net/base/net_errors.h"
#include "net/base/x509_certificate.h"
#include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h"
@@ -106,9 +108,23 @@ void CertDatabase::ListCerts(CertificateList* certs) {
CERT_DestroyCertList(cert_list);
}
+CryptoModule* CertDatabase::GetDefaultModule() const {
+ CryptoModule* module =
+ CryptoModule::CreateFromHandle(base::GetDefaultNSSKeySlot());
+ // The module is already referenced when returned from GetDefaultNSSKeymodule,
+ // so we need to deref it once.
+ PK11_FreeSlot(module->os_module_handle());
+
+ return module;
+}
+
int CertDatabase::ImportFromPKCS12(
- const std::string& data, const string16& password) {
- return psm::nsPKCS12Blob_Import(data.data(), data.size(), password);
+ net::CryptoModule* module,
+ const std::string& data,
+ const string16& password) {
+ return psm::nsPKCS12Blob_Import(module->os_module_handle(),
+ data.data(), data.size(),
+ password);
}
int CertDatabase::ExportToPKCS12(
« no previous file with comments | « net/base/cert_database.h ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698