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

Unified Diff: net/base/keygen_handler_nss.cc

Issue 384413004: Remove default key slot from KeygenHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Less invasive approach. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/keygen_handler_unittest.cc » ('j') | net/base/keygen_handler_unittest.cc » ('J')
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 e5f28ac190830b497c7387e50e8c9f6af7a2cac6..661dabc7710d056aac8d02843b4828e6547c376f 100644
--- a/net/base/keygen_handler_nss.cc
+++ b/net/base/keygen_handler_nss.cc
@@ -7,7 +7,6 @@
#include "base/logging.h"
#include "crypto/nss_crypto_module_delegate.h"
#include "crypto/nss_util.h"
-#include "crypto/nss_util_internal.h"
#include "crypto/scoped_nss_types.h"
#include "net/third_party/mozilla_security_manager/nsKeygenHandler.h"
@@ -17,26 +16,21 @@ namespace psm = mozilla_security_manager;
namespace net {
std::string KeygenHandler::GenKeyAndSignChallenge() {
- // Ensure NSS is initialized.
crypto::EnsureNSSInit();
crypto::ScopedPK11Slot slot;
- if (crypto_module_delegate_)
+ if (crypto_module_delegate_) {
slot = crypto_module_delegate_->RequestSlot().Pass();
- else
- slot.reset(crypto::GetPersistentNSSKeySlot());
- if (!slot.get()) {
- LOG(ERROR) << "Couldn't get private key slot from NSS!";
+ } else {
+ LOG(ERROR) << "Could not get an NSS key slot.";
return std::string();
}
// Authenticate to the token.
- if (SECSuccess !=
- PK11_Authenticate(
- slot.get(),
- PR_TRUE,
- crypto_module_delegate_ ? crypto_module_delegate_->wincx() : NULL)) {
- LOG(ERROR) << "Couldn't authenticate to private key slot!";
+ if (SECSuccess != PK11_Authenticate(slot.get(),
+ PR_TRUE,
+ crypto_module_delegate_->wincx())) {
+ LOG(ERROR) << "Could not authenticate to the key slot.";
return std::string();
}
« no previous file with comments | « no previous file | net/base/keygen_handler_unittest.cc » ('j') | net/base/keygen_handler_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698