OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/auth/key.h" | 5 #include "chromeos/login/auth/key.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace chromeos { | 9 namespace chromeos { |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 const char kPassword[] = "password"; | 13 const char kPassword[] = "password"; |
14 const char kLabel[] = "label"; | 14 const char kLabel[] = "label"; |
15 const char kSalt[] = | 15 const char kSalt[] = |
(...skipping 22 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 TEST(KeyTest, TransformToSaltedAES2561234) { | 40 TEST(KeyTest, TransformToSaltedAES2561234) { |
41 Key key(kPassword); | 41 Key key(kPassword); |
42 key.Transform(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, kSalt); | 42 key.Transform(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, kSalt); |
43 EXPECT_EQ(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, key.GetKeyType()); | 43 EXPECT_EQ(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, key.GetKeyType()); |
44 EXPECT_EQ("GUkNnvqoULf/cXbZscVUnANmLBB0ovjGZsj1sKzP5BE=", key.GetSecret()); | 44 EXPECT_EQ("GUkNnvqoULf/cXbZscVUnANmLBB0ovjGZsj1sKzP5BE=", key.GetSecret()); |
45 } | 45 } |
46 | 46 |
47 } // namespace chromeos | 47 } // namespace chromeos |
OLD | NEW |