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

Unified Diff: chromeos/login/auth/cryptohome_authenticator.cc

Issue 2801873007: Resume encryption migration immediately if the previous migration is incomplete. (Closed)
Patch Set: Created 3 years, 8 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 | « chromeos/login/auth/cryptohome_authenticator.h ('k') | chromeos/login/auth/login_performer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/login/auth/cryptohome_authenticator.cc
diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/chromeos/login/auth/cryptohome_authenticator.cc
index a301fccce6f4a405e914079f2cd0530f6d77b77c..a4f98d23be13501898b09f071522baf656f68650 100644
--- a/chromeos/login/auth/cryptohome_authenticator.cc
+++ b/chromeos/login/auth/cryptohome_authenticator.cc
@@ -660,10 +660,13 @@ void CryptohomeAuthenticator::OnPasswordChangeDetected() {
consumer_->OnPasswordChangeDetected();
}
-void CryptohomeAuthenticator::OnOldEncryptionDetected() {
+void CryptohomeAuthenticator::OnOldEncryptionDetected(
+ bool has_incomplete_migration) {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
- if (consumer_)
- consumer_->OnOldEncryptionDetected(current_state_->user_context);
+ if (consumer_) {
+ consumer_->OnOldEncryptionDetected(current_state_->user_context,
+ has_incomplete_migration);
+ }
}
void CryptohomeAuthenticator::OnAuthFailure(const AuthFailure& error) {
@@ -865,12 +868,14 @@ void CryptohomeAuthenticator::Resolve() {
break;
}
case FAILED_OLD_ENCRYPTION:
+ case FAILED_PREVIOUS_MIGRATION_INCOMPLETE:
// In this case, we tried to create/mount cryptohome and failed
// because the file system is encrypted in old format.
// Chrome will show a screen which asks user to migrate the encryption.
task_runner_->PostTask(
FROM_HERE,
- base::Bind(&CryptohomeAuthenticator::OnOldEncryptionDetected, this));
+ base::Bind(&CryptohomeAuthenticator::OnOldEncryptionDetected, this,
+ state == FAILED_PREVIOUS_MIGRATION_INCOMPLETE));
break;
default:
NOTREACHED();
@@ -948,6 +953,10 @@ CryptohomeAuthenticator::ResolveCryptohomeFailureState() {
cryptohome::MOUNT_ERROR_OLD_ENCRYPTION) {
return FAILED_OLD_ENCRYPTION;
}
+ if (current_state_->cryptohome_code() ==
+ cryptohome::MOUNT_ERROR_PREVIOUS_MIGRATION_INCOMPLETE) {
+ return FAILED_PREVIOUS_MIGRATION_INCOMPLETE;
+ }
// Return intermediate states in the following case:
// when there is an online result to use;
« no previous file with comments | « chromeos/login/auth/cryptohome_authenticator.h ('k') | chromeos/login/auth/login_performer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698