Commit ee8e323e authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Fix email comparison in dice_response_handler

The DCHECK was comparing emails by doing a simple string comparison.
This is incorrect, because emails have to be normalized first. In
particular emails are case insensitive.

Bug: 882362
Change-Id: I1b0009bb1f6b77114638db250252d79126f2267d
Reviewed-on: https://chromium-review.googlesource.com/1240295Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593512}
parent ffc9edd5
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "components/signin/core/browser/signin_manager.h" #include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/signin_metrics.h" #include "components/signin/core/browser/signin_metrics.h"
#include "google_apis/gaia/gaia_auth_fetcher.h" #include "google_apis/gaia/gaia_auth_fetcher.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/gaia_constants.h" #include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/google_service_auth_error.h" #include "google_apis/gaia/google_service_auth_error.h"
...@@ -353,7 +354,7 @@ void DiceResponseHandler::ProcessEnableSyncHeader( ...@@ -353,7 +354,7 @@ void DiceResponseHandler::ProcessEnableSyncHeader(
for (auto it = token_fetchers_.begin(); it != token_fetchers_.end(); ++it) { for (auto it = token_fetchers_.begin(); it != token_fetchers_.end(); ++it) {
DiceTokenFetcher* fetcher = it->get(); DiceTokenFetcher* fetcher = it->get();
if (fetcher->gaia_id() == gaia_id) { if (fetcher->gaia_id() == gaia_id) {
DCHECK_EQ(fetcher->email(), email); DCHECK(gaia::AreEmailsSame(fetcher->email(), email));
// If there is a fetch in progress for a resfresh token for the given // If there is a fetch in progress for a resfresh token for the given
// account, then simply mark it to enable sync after the refresh token is // account, then simply mark it to enable sync after the refresh token is
// available. // available.
......
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