Commit 4f468d60 authored by A Olsen's avatar A Olsen Committed by Commit Bot

Add OnPasswordChangeDetected override to pw change manager.

Trying to change the cryptohome password but supplying the wrong
old password, can result in an "OnPasswordChangeDetected" instead
of an OnAuthFailure. So, detect either one and treat them both
as "incorrect old password", prompting the user to try again.

Bug: 930109
Change-Id: I9aae5a52e377215f55ea0f788ff0ffacd2118865
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724076Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: A Olsen <olsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681766}
parent 6074090c
......@@ -287,6 +287,11 @@ void InSessionPasswordChangeManager::OnAuthFailure(const AuthFailure& error) {
NotifyObservers(CRYPTOHOME_PASSWORD_CHANGE_FAILURE);
}
void InSessionPasswordChangeManager::OnPasswordChangeDetected() {
VLOG(1) << "Failed to change cryptohome password: PasswordChangeDetected";
NotifyObservers(CRYPTOHOME_PASSWORD_CHANGE_FAILURE);
}
void InSessionPasswordChangeManager::OnAuthSuccess(
const UserContext& user_context) {
VLOG(3) << "Cryptohome password is changed.";
......
......@@ -145,6 +145,7 @@ class InSessionPasswordChangeManager : public AuthStatusConsumer,
// AuthStatusConsumer:
void OnAuthFailure(const AuthFailure& error) override;
void OnPasswordChangeDetected() override;
void OnAuthSuccess(const UserContext& user_context) override;
// ash::SessionActivationObserver:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment