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

Unified Diff: chrome/browser/chromeos/login/user_manager.cc

Issue 9389028: Make nss/TPM integration in ChromeOS more robust. (Closed) Base URL: http://git.chromium.org/git/chromium/src@master
Patch Set: Add check and comment. Created 8 years, 10 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 | crypto/nss_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/user_manager.cc
diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc
index e4c7390408ccb4fbafea4bc505e89222a9a8778e..67b6df9cfe6f8ca8510ee3c29c43716445f7821f 100644
--- a/chrome/browser/chromeos/login/user_manager.cc
+++ b/chrome/browser/chromeos/login/user_manager.cc
@@ -238,15 +238,15 @@ bool RealTPMTokenInfoDelegate::IsTokenAvailable() const {
}
bool RealTPMTokenInfoDelegate::IsTokenReady() const {
+ if (token_ready_)
+ return true;
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
wtc 2012/02/15 01:41:32 Should this CHECK be the first line of this functi
stevenjb 2012/02/15 01:58:51 Comment added.
- if (!token_ready_) {
- // Retrieve token_name_ and user_pin_ here since they will never change
- // and CryptohomeLibrary calls are not thread safe.
- if (CrosLibrary::Get()->GetCryptohomeLibrary()->Pkcs11IsTpmTokenReady()) {
- CrosLibrary::Get()->GetCryptohomeLibrary()->Pkcs11GetTpmTokenInfo(
- &token_name_, &user_pin_);
- token_ready_ = true;
- }
+ // Retrieve token_name_ and user_pin_ here since they will never change
+ // and CryptohomeLibrary calls are not thread safe.
+ if (CrosLibrary::Get()->GetCryptohomeLibrary()->Pkcs11IsTpmTokenReady()) {
+ CrosLibrary::Get()->GetCryptohomeLibrary()->Pkcs11GetTpmTokenInfo(
+ &token_name_, &user_pin_);
+ token_ready_ = true;
}
return token_ready_;
}
@@ -725,6 +725,7 @@ void UserManager::StubUserLoggedIn() {
}
void UserManager::NotifyOnLogin() {
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_LOGIN_USER_CHANGED,
content::Source<UserManager>(this),
@@ -752,6 +753,7 @@ void UserManager::NotifyOnLogin() {
crypto::EnableTPMTokenForNSS(new RealTPMTokenInfoDelegate());
CertLibrary* cert_library;
cert_library = chromeos::CrosLibrary::Get()->GetCertLibrary();
+ // Note: this calls crypto::EnsureTPMTokenReady()
cert_library->RequestCertificates();
}
« no previous file with comments | « no previous file | crypto/nss_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698