Commit f522435e authored by Quan Nguyen's avatar Quan Nguyen Committed by Commit Bot

cros: Remove system salt fetch in DoAuthenticateUser

The system salt is no longer needed for authentication.
Also remove unused PendingDoAuthenticateUser declaration.

Bug: 902161
Change-Id: I7920f2975cf4b547149caa2d0c7056085d6dab2a
Reviewed-on: https://chromium-review.googlesource.com/c/1318632
Commit-Queue: Quan Nguyen <qnnguyen@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605568}
parent f8d1900f
......@@ -25,7 +25,6 @@
#include "base/debug/alias.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chromeos/cryptohome/system_salt_getter.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/session_manager/session_manager_types.h"
......@@ -122,13 +121,15 @@ void LoginScreenController::AuthenticateUserWithPasswordOrPin(
return;
}
// |DoAuthenticateUser| requires the system salt.
authentication_stage_ = AuthenticationStage::kGetSystemSalt;
chromeos::SystemSaltGetter::Get()->GetSystemSalt(
base::AdaptCallbackForRepeating(
base::BindOnce(&LoginScreenController::DoAuthenticateUser,
weak_factory_.GetWeakPtr(), account_id, password,
authenticated_by_pin, std::move(callback))));
authentication_stage_ = AuthenticationStage::kDoAuthenticate;
int dummy_value;
bool is_pin =
authenticated_by_pin && base::StringToInt(password, &dummy_value);
login_screen_client_->AuthenticateUserWithPasswordOrPin(
account_id, password, is_pin,
base::BindOnce(&LoginScreenController::OnAuthenticateComplete,
weak_factory_.GetWeakPtr(), base::Passed(&callback)));
}
void LoginScreenController::AuthenticateUserWithExternalBinary(
......@@ -532,24 +533,6 @@ void LoginScreenController::FocusOobeDialog() {
login_screen_client_->FocusOobeDialog();
}
void LoginScreenController::DoAuthenticateUser(const AccountId& account_id,
const std::string& password,
bool authenticated_by_pin,
OnAuthenticateCallback callback,
const std::string& system_salt) {
// TODO(jdufault): Simplify this, system_salt is no longer used so fetching
// the system salt can be skipped.
authentication_stage_ = AuthenticationStage::kDoAuthenticate;
int dummy_value;
bool is_pin =
authenticated_by_pin && base::StringToInt(password, &dummy_value);
login_screen_client_->AuthenticateUserWithPasswordOrPin(
account_id, password, is_pin,
base::BindOnce(&LoginScreenController::OnAuthenticateComplete,
weak_factory_.GetWeakPtr(), base::Passed(&callback)));
}
void LoginScreenController::OnAuthenticateComplete(
OnAuthenticateCallback callback,
bool success) {
......
......@@ -30,7 +30,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
// The current authentication stage. Used to get more verbose logging.
enum class AuthenticationStage {
kIdle,
kGetSystemSalt,
kDoAuthenticate,
kUserCallback,
};
......@@ -162,14 +161,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
}
private:
using PendingDoAuthenticateUser =
base::OnceCallback<void(const std::string& system_salt)>;
void DoAuthenticateUser(const AccountId& account_id,
const std::string& password,
bool authenticated_by_pin,
OnAuthenticateCallback callback,
const std::string& system_salt);
void OnAuthenticateComplete(OnAuthenticateCallback callback, bool success);
// Returns the active data dispatcher or nullptr if there is no lock screen.
......
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