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

Unified Diff: crypto/nss_util.cc

Issue 424523002: Enable system NSS key slot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: crypto/nss_util.cc
diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc
index 3915b7597953f66e5671927cd66d1273f06791ed..fdf2b3793d7a43e52dcec4acdc9ce8d2ff244db1 100644
--- a/crypto/nss_util.cc
+++ b/crypto/nss_util.cc
@@ -573,11 +573,17 @@ class NSSInitSingleton {
chromeos_user_map_.erase(i);
}
- void SetSystemKeySlotForTesting(ScopedPK11Slot slot) {
+ void SetSystemKeySlotForTesting(bool skip_tpm_initialization,
+ ScopedPK11Slot slot) {
// Ensure that a previous value of test_system_slot_ is not overwritten.
// Unsetting, i.e. setting a NULL, however is allowed.
DCHECK(!slot || !test_system_slot_);
test_system_slot_ = slot.Pass();
+ if (skip_tpm_initialization) {
+ EnableTPMTokenForNSS();
+ CHECK(test_system_slot_);
+ tpm_slot_ = PK11_ReferenceSlot(test_system_slot_.get());
+ }
}
#endif // defined(OS_CHROMEOS)
@@ -1015,8 +1021,10 @@ ScopedPK11Slot GetSystemNSSKeySlot(
return g_nss_singleton.Get().GetSystemNSSKeySlot(callback);
}
-void SetSystemKeySlotForTesting(ScopedPK11Slot slot) {
- g_nss_singleton.Get().SetSystemKeySlotForTesting(ScopedPK11Slot());
+void SetSystemKeySlotForTesting(bool skip_tpm_initialization,
+ ScopedPK11Slot slot) {
+ g_nss_singleton.Get().SetSystemKeySlotForTesting(skip_tpm_initialization,
+ slot.Pass());
}
void EnableTPMTokenForNSS() {

Powered by Google App Engine
This is Rietveld 408576698