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

Unified Diff: net/base/keygen_handler_nss.cc

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: certdb: handle GetCertTrust and IsUntrusted, failed attempt to handle SetCertTrust Created 7 years, 1 month 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/keygen_handler.h ('k') | net/base/keygen_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/keygen_handler_nss.cc
diff --git a/net/base/keygen_handler_nss.cc b/net/base/keygen_handler_nss.cc
index 5e97807866ab3bbfd70e2d32779ad0eb91c8a227..854d62de694ff5b34c4aeecf99572730ede32d48 100644
--- a/net/base/keygen_handler_nss.cc
+++ b/net/base/keygen_handler_nss.cc
@@ -17,29 +17,26 @@ namespace psm = mozilla_security_manager;
namespace net {
std::string KeygenHandler::GenKeyAndSignChallenge() {
- // Ensure NSS is initialized.
- crypto::EnsureNSSInit();
-
- // TODO(mattm): allow choosing which slot to generate and store the key.
- crypto::ScopedPK11Slot slot(crypto::GetPrivateNSSKeySlot());
- if (!slot.get()) {
+ if (!slot_.get()) {
LOG(ERROR) << "Couldn't get private key slot from NSS!";
return std::string();
}
// Authenticate to the token.
- if (SECSuccess != PK11_Authenticate(slot.get(), PR_TRUE,
+ if (SECSuccess != PK11_Authenticate(slot_.get(), PR_TRUE,
crypto_module_password_delegate_.get())) {
LOG(ERROR) << "Couldn't authenticate to private key slot!";
return std::string();
}
return psm::GenKeyAndSignChallenge(key_size_in_bits_, challenge_, url_,
- slot.get(), stores_key_);
+ slot_.get(), stores_key_);
}
-void KeygenHandler::set_crypto_module_password_delegate(
+void KeygenHandler::set_key_slot(
+ crypto::ScopedPK11Slot slot,
crypto::CryptoModuleBlockingPasswordDelegate* delegate) {
+ slot_ = slot.Pass();
crypto_module_password_delegate_.reset(delegate);
}
« no previous file with comments | « net/base/keygen_handler.h ('k') | net/base/keygen_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698