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

Unified Diff: tpm.cc

Issue 3384032: Only check the well-known password if we know it is not owned. (Closed) Base URL: http://git.chromium.org/git/tpm_init.git
Patch Set: Created 10 years, 3 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.cc
diff --git a/tpm.cc b/tpm.cc
index 6183e7031628f48c022aabddc95789d899586c58..1efa15c57d68bac73148e49045d460883b01933a 100644
--- a/tpm.cc
+++ b/tpm.cc
@@ -568,7 +568,8 @@ bool Tpm::InitializeTpm(bool* OUT_took_ownership) {
// If we can open the TPM with the default password, then we still need to
// zero the SRK password and unrestrict it, then change the owner password.
TSS_HTPM tpm_handle;
- if (GetTpmWithAuth(context_handle_, default_owner_password, &tpm_handle) &&
+ if (!file_util::PathExists(FilePath(kTpmOwnedFile)) &&
+ GetTpmWithAuth(context_handle_, default_owner_password, &tpm_handle) &&
TestTpmAuth(tpm_handle)) {
if (!ZeroSrkPassword(context_handle_, default_owner_password)) {
LOG(ERROR) << "Couldn't zero SRK password";
« 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