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

Unified Diff: tpm_init.cc

Issue 3674006: Fix TpmIsReady regression. (Closed) Base URL: http://git.chromium.org/git/tpm_init.git
Patch Set: Created 10 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tpm_init.cc
diff --git a/tpm_init.cc b/tpm_init.cc
index 3178790fb89f4e8c0372ef8abed6d4c586eeccd2..ae02592b19557837dc79b07d27c06843eba6c2d6 100644
--- a/tpm_init.cc
+++ b/tpm_init.cc
@@ -83,22 +83,10 @@ bool TpmInit::StartInitializeTpm() {
}
bool TpmInit::IsTpmReady() {
- // The TPM is not "ready" if the init call has not completed. It may be in
- // the middle of taking ownership.
- if (!task_done_) {
- return false;
- }
- // If initialize_took_ownership_ is true, then the TPM went through a full
- // succesful ownership cycle in InitializeTpm()
- if (initialize_took_ownership_) {
- return true;
- }
- // If we get here, then the call to InitializeTpm() is complete and it
- // returned false. That merely means that it did not successfully take
- // ownership, which is the common case after ownership is established on OOBE.
- // In that case, the TPM is ready if it is enabled and owned.
+ // The TPM is "ready" if it is enabled, owned, and not being owned.
return (tpm_init_task_->get_tpm()->IsEnabled() &&
- tpm_init_task_->get_tpm()->IsOwned());
+ tpm_init_task_->get_tpm()->IsOwned() &&
+ !tpm_init_task_->get_tpm()->IsBeingOwned());
}
bool TpmInit::IsTpmEnabled() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698