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

Side by Side Diff: remoting/host/pin_hash_unittest.cc

Issue 10243011: [Chromoting] Factor out common code for pin hashing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <set>
6 #include <string>
7
8 #include "remoting/host/pin_hash.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace remoting {
12
13 class PinHashTest : public testing::Test {
14 };
15
16 TEST_F(PinHashTest, KnownHashValue) {
17 std::string hash = MakeHostPinHash("Host ID", "1234");
18 ASSERT_EQ("hmac:bk6RVRFLpLO89mr4QPHSg8CemUUtI90r2F0VfvTmWLI=", hash);
19 }
20
21 TEST_F(PinHashTest, VerifyHostPinHash) {
22 std::string host_id("Host ID");
23 std::string pin("1234");
24 ASSERT_TRUE(VerifyHostPinHash(MakeHostPinHash(host_id, pin), host_id, pin));
Wez 2012/05/01 01:02:36 Verify that it returns false if you supply differe
simonmorris 2012/05/01 01:11:55 Done.
25 }
26
27 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698