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

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: Minor changes. 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 29a0b6686fe21d30c4152359a54252b3b4408701..0f10bd196d9acae199b7e9183311023ad3a1c1c3 100644
--- a/crypto/nss_util.cc
+++ b/crypto/nss_util.cc
@@ -579,6 +579,12 @@ class NSSInitSingleton {
// Unsetting, i.e. setting a NULL, however is allowed.
DCHECK(!slot || !test_system_slot_);
test_system_slot_ = slot.Pass();
+ if (test_system_slot_) {
+ EnableTPMTokenForNSS();
pneubeck (no reviews) 2014/07/31 06:31:25 This one should actually not be necessary and I'll
+ tpm_slot_.reset(PK11_ReferenceSlot(test_system_slot_.get()));
mattm 2014/07/30 22:57:34 need to call tpm_ready_callback_list_ callbacks to
pneubeck (no reviews) 2014/07/31 06:31:25 These callbacks are usually triggered by a Initial
mattm 2014/07/31 10:29:30 Right, my point was when the test uses software sl
pneubeck (no reviews) 2014/07/31 10:48:54 Setting tpm_slot_ toggles IsTPMTokenReady to true
pneubeck (no reviews) 2014/08/01 10:02:28 Thinking about this again, I see now what you mean
+ } else {
+ tpm_slot_.reset();
+ }
}
#endif // defined(OS_CHROMEOS)
@@ -1014,7 +1020,7 @@ ScopedPK11Slot GetSystemNSSKeySlot(
}
void SetSystemKeySlotForTesting(ScopedPK11Slot slot) {
- g_nss_singleton.Get().SetSystemKeySlotForTesting(ScopedPK11Slot());
+ g_nss_singleton.Get().SetSystemKeySlotForTesting(slot.Pass());
}
void EnableTPMTokenForNSS() {

Powered by Google App Engine
This is Rietveld 408576698