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

Unified Diff: mount.cc

Issue 3177029: Upgrade TPM key storage from downlevel versions. (Closed) Base URL: http://src.chromium.org/git/cryptohome.git
Patch Set: Created 10 years, 4 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 | « crypto.cc ('k') | tpm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mount.cc
diff --git a/mount.cc b/mount.cc
index d8a1c3b49850e3fc2b60b1c748f4705dc7ffefa3..8b38884a9c884bf2fa638ebac8be1fe7962931b7 100644
--- a/mount.cc
+++ b/mount.cc
@@ -399,12 +399,16 @@ bool Mount::UnwrapVaultKeyset(const Credentials& credentials,
bool should_tpm = (crypto_->has_tpm() && use_tpm_);
bool should_scrypt = fallback_to_scrypt_;
do {
- if (tpm_wrapped && should_tpm)
- break; // 5, 8
- if (scrypt_wrapped && should_scrypt && !should_tpm)
- break; // 12
- if (!tpm_wrapped && !scrypt_wrapped && !should_tpm && !should_scrypt)
- break; // 1
+ // If the keyset was TPM-wrapped, but there was no public key hash,
+ // always re-save. Otherwise, check the table.
+ if (crypto_error != Crypto::CE_NO_PUBLIC_KEY_HASH) {
+ if (tpm_wrapped && should_tpm)
+ break; // 5, 8
+ if (scrypt_wrapped && should_scrypt && !should_tpm)
+ break; // 12
+ if (!tpm_wrapped && !scrypt_wrapped && !should_tpm && !should_scrypt)
+ break; // 1
+ }
// TODO(fes): This is not (right now) a fatal error
ResaveVaultKeyset(credentials, *vault_keyset);
} while(false);
« no previous file with comments | « crypto.cc ('k') | tpm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698