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

Unified Diff: chrome/browser/chromeos/login/managed/supervised_user_authentication_unittest.cc

Issue 296773002: Add a Key class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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
Index: chrome/browser/chromeos/login/managed/supervised_user_authentication_unittest.cc
diff --git a/chrome/browser/chromeos/login/managed/supervised_user_authentication_unittest.cc b/chrome/browser/chromeos/login/managed/supervised_user_authentication_unittest.cc
index d2bbd8835b84c2d3feae4aac52c355ae5dc75290..7456ced0be64fcc6872d6a6239106fba8ee3f559 100644
--- a/chrome/browser/chromeos/login/managed/supervised_user_authentication_unittest.cc
+++ b/chrome/browser/chromeos/login/managed/supervised_user_authentication_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/login/managed/supervised_user_authentication.h"
#include "base/values.h"
+#include "chrome/browser/chromeos/login/auth/key.h"
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,12 +41,11 @@ TEST_F(SupervisedUserAuthenticationTest, SignatureGeneration) {
std::string expected_signature =
"KOPQmmJcMr9iMkr36N1cX+G9gDdBBu7zutAxNayPMN4=";
- std::string salted_password =
- SupervisedUserAuthentication::BuildPasswordForHashWithSaltSchema(
- salt, password);
- ASSERT_EQ(expected_salted_password, salted_password);
+ Key key(password);
+ key.Transform(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, salt);
+ ASSERT_EQ(expected_salted_password, key.GetSecret());
std::string signature = SupervisedUserAuthentication::BuildPasswordSignature(
- salted_password, revision, signature_key);
+ key.GetSecret(), revision, signature_key);
ASSERT_EQ(expected_signature, signature);
}

Powered by Google App Engine
This is Rietveld 408576698