diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 22:30:12 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 22:30:12 +0000 |
commit | 2125cde44a633323dbe924ee09b21c07445f494a (patch) | |
tree | 0aa6d13feb64c7c37ed5f19ebf1a7bda01012b96 | |
parent | e08b9a5af9ecf153213417dd96b0440d1ba841c3 (diff) | |
download | chromium_src-2125cde44a633323dbe924ee09b21c07445f494a.zip chromium_src-2125cde44a633323dbe924ee09b21c07445f494a.tar.gz chromium_src-2125cde44a633323dbe924ee09b21c07445f494a.tar.bz2 |
Removed legacy encoding mechanism that was temporarely used at one point while WebUI was still being developed.
BUG=chromium-os:20875
TEST=none
Review URL: http://codereview.chromium.org/8332013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106996 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 2 insertions, 45 deletions
diff --git a/chrome/browser/chromeos/login/authenticator.h b/chrome/browser/chromeos/login/authenticator.h index 8c7e6be..28d0315 100644 --- a/chrome/browser/chromeos/login/authenticator.h +++ b/chrome/browser/chromeos/login/authenticator.h @@ -97,9 +97,6 @@ class Authenticator : public base::RefCountedThreadSafe<Authenticator> { // OAuth token encryption helpers. virtual std::string EncryptToken(const std::string& token) = 0; virtual std::string DecryptToken(const std::string& encrypted_token) = 0; - // TODO(zelidrag): Remove legacy encryption support in R16. - virtual std::string DecryptLegacyToken( - const std::string& encrypted_token) = 0; // Profile (usually off the record ) that was used to perform the last // authentication process. diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index a1a6425..e373d0d 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -1092,19 +1092,8 @@ bool LoginUtilsImpl::ReadOAuth1AccessToken(Profile* user_profile, DCHECK(authenticator_.get()); std::string decoded_token = authenticator_->DecryptToken(encoded_token); std::string decoded_secret = authenticator_->DecryptToken(encoded_secret); - if (!decoded_token.length() || !decoded_secret.length()) { - // TODO(zelidrag): Remove legacy encryption support in R16. - // Check if tokens were encoded with the legacy encryption instead. - decoded_token = authenticator_->DecryptLegacyToken(encoded_token); - decoded_secret = authenticator_->DecryptLegacyToken(encoded_secret); - if (!decoded_token.length() || !decoded_secret.length()) - return false; - - pref_service->SetString(prefs::kOAuth1Token, - authenticator_->EncryptToken(decoded_token)); - pref_service->SetString(prefs::kOAuth1Secret, - authenticator_->EncryptToken(decoded_secret)); - } + if (!decoded_token.length() || !decoded_secret.length()) + return false; *token = decoded_token; *secret = decoded_secret; diff --git a/chrome/browser/chromeos/login/mock_authenticator.cc b/chrome/browser/chromeos/login/mock_authenticator.cc index a224b91..eac9584 100644 --- a/chrome/browser/chromeos/login/mock_authenticator.cc +++ b/chrome/browser/chromeos/login/mock_authenticator.cc @@ -69,11 +69,6 @@ std::string MockAuthenticator::DecryptToken( return std::string(); } -std::string MockAuthenticator::DecryptLegacyToken( - const std::string& encrypted_token) { - return std::string(); -} - //////////////////////////////////////////////////////////////////////////////// // MockLoginUtils diff --git a/chrome/browser/chromeos/login/mock_authenticator.h b/chrome/browser/chromeos/login/mock_authenticator.h index 1d2eecb..c049751 100644 --- a/chrome/browser/chromeos/login/mock_authenticator.h +++ b/chrome/browser/chromeos/login/mock_authenticator.h @@ -70,8 +70,6 @@ class MockAuthenticator : public Authenticator { virtual std::string DecryptToken(const std::string& encrypted_token); - virtual std::string DecryptLegacyToken(const std::string& encrypted_token); - virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, const std::string& oauth1_secret) {} diff --git a/chrome/browser/chromeos/login/parallel_authenticator.cc b/chrome/browser/chromeos/login/parallel_authenticator.cc index ff5ef7f..9dd84c7 100644 --- a/chrome/browser/chromeos/login/parallel_authenticator.cc +++ b/chrome/browser/chromeos/login/parallel_authenticator.cc @@ -751,15 +751,6 @@ std::string ParallelAuthenticator::DecryptToken( encrypted_token_hex); } -std::string ParallelAuthenticator::DecryptLegacyToken( - const std::string& encrypted_token_hex) { - scoped_ptr<crypto::SymmetricKey> key( - crypto::SymmetricKey::DeriveKeyFromPassword( - crypto::SymmetricKey::AES, UserSupplementalKeyAsAscii(), - SaltAsAscii(), 1000, 256)); - return DecryptTokenWithKey(key.get(), SaltAsAscii(), encrypted_token_hex); -} - std::string ParallelAuthenticator::HashPassword(const std::string& password) { // Get salt, ascii encode, update sha with that, then update with ascii // of password, then end. @@ -782,12 +773,6 @@ std::string ParallelAuthenticator::SaltAsAscii() { system_salt_.size())); } -std::string ParallelAuthenticator::UserSupplementalKeyAsAscii() { - // TODO(zelidrag, wad): http://crosbug.com/18633 - Replace this with the real - // user suplemental key gets exposed in from cryptolib. - return SaltAsAscii(); -} - void ParallelAuthenticator::ResolveLoginCompletionStatus() { // Shortcut online state resolution process. current_state_->RecordOnlineLoginStatus(GaiaAuthConsumer::ClientLoginResult(), diff --git a/chrome/browser/chromeos/login/parallel_authenticator.h b/chrome/browser/chromeos/login/parallel_authenticator.h index 98dc49b..af8ab91 100644 --- a/chrome/browser/chromeos/login/parallel_authenticator.h +++ b/chrome/browser/chromeos/login/parallel_authenticator.h @@ -151,8 +151,6 @@ class ParallelAuthenticator : public Authenticator, const std::string& oauth1_secret) OVERRIDE; virtual std::string EncryptToken(const std::string& token) OVERRIDE; virtual std::string DecryptToken(const std::string& encrypted_token) OVERRIDE; - virtual std::string DecryptLegacyToken( - const std::string& encrypted_token) OVERRIDE; // AuthAttemptStateResolver overrides. // Attempts to make a decision and call back |consumer_| based on @@ -247,11 +245,6 @@ class ParallelAuthenticator : public Authenticator, // Returns the ascii encoding of the system salt. std::string SaltAsAscii(); - // Returns the ascii encoding of user supplemental key. - // TODO(zelidrag): http://crosbug.com/18905. Replace this with a key from - // nssdb instead. - std::string UserSupplementalKeyAsAscii(); - // Signal login completion status for cases when a new user is added via // an external authentication provider (i.e. GAIA extension). void ResolveLoginCompletionStatus(); |