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

Side by Side Diff: remoting/protocol/spake2_authenticator_unittest.cc

Issue 1780403002: Enable Curve25519 in host and client for PIN-based and third-party auth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « remoting/protocol/spake2_authenticator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "remoting/protocol/spake2_authenticator.h" 5 #include "remoting/protocol/spake2_authenticator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "remoting/base/rsa_key_pair.h" 9 #include "remoting/base/rsa_key_pair.h"
10 #include "remoting/protocol/authenticator_test_base.h" 10 #include "remoting/protocol/authenticator_test_base.h"
(...skipping 24 matching lines...) Expand all
35 } // namespace 35 } // namespace
36 36
37 class Spake2AuthenticatorTest : public AuthenticatorTestBase { 37 class Spake2AuthenticatorTest : public AuthenticatorTestBase {
38 public: 38 public:
39 Spake2AuthenticatorTest() {} 39 Spake2AuthenticatorTest() {}
40 ~Spake2AuthenticatorTest() override {} 40 ~Spake2AuthenticatorTest() override {}
41 41
42 protected: 42 protected:
43 void InitAuthenticators(const std::string& client_secret, 43 void InitAuthenticators(const std::string& client_secret,
44 const std::string& host_secret) { 44 const std::string& host_secret) {
45 host_ = Spake2Authenticator::CreateForHost(kHostId, kClientId, host_secret, 45 host_ = Spake2Authenticator::CreateForHost(kHostId, kClientId, host_cert_,
46 host_cert_, key_pair_, 46 key_pair_, host_secret,
47 Authenticator::WAITING_MESSAGE); 47 Authenticator::WAITING_MESSAGE);
48 client_ = Spake2Authenticator::CreateForClient( 48 client_ = Spake2Authenticator::CreateForClient(
49 kClientId, kHostId, client_secret, Authenticator::MESSAGE_READY); 49 kClientId, kHostId, client_secret, Authenticator::MESSAGE_READY);
50 } 50 }
51 51
52 DISALLOW_COPY_AND_ASSIGN(Spake2AuthenticatorTest); 52 DISALLOW_COPY_AND_ASSIGN(Spake2AuthenticatorTest);
53 }; 53 };
54 54
55 TEST_F(Spake2AuthenticatorTest, SuccessfulAuth) { 55 TEST_F(Spake2AuthenticatorTest, SuccessfulAuth) {
56 ASSERT_NO_FATAL_FAILURE( 56 ASSERT_NO_FATAL_FAILURE(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ASSERT_TRUE(message.get()); 89 ASSERT_TRUE(message.get());
90 90
91 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state()); 91 ASSERT_EQ(Authenticator::WAITING_MESSAGE, client_->state());
92 host_->ProcessMessage(message.get(), base::Bind(&base::DoNothing)); 92 host_->ProcessMessage(message.get(), base::Bind(&base::DoNothing));
93 // This assumes that Spake2Authenticator::ProcessMessage runs synchronously. 93 // This assumes that Spake2Authenticator::ProcessMessage runs synchronously.
94 ASSERT_EQ(Authenticator::REJECTED, host_->state()); 94 ASSERT_EQ(Authenticator::REJECTED, host_->state());
95 } 95 }
96 96
97 } // namespace protocol 97 } // namespace protocol
98 } // namespace remoting 98 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/spake2_authenticator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698