#include <memory>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/mock_callback.h"
#include "net/base/net_errors.h"
#include "remoting/base/rsa_key_pair.h"
#include "remoting/protocol/auth_util.h"
#include "remoting/protocol/authenticator.h"
#include "remoting/protocol/authenticator_test_base.h"
#include "remoting/protocol/channel_authenticator.h"
#include "remoting/protocol/connection_tester.h"
#include "remoting/protocol/credentials_type.h"
#include "remoting/protocol/host_authentication_config.h"
#include "remoting/protocol/negotiating_authenticator_base.h"
#include "remoting/protocol/negotiating_client_authenticator.h"
#include "remoting/protocol/negotiating_host_authenticator.h"
#include "remoting/protocol/pairing_registry.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libjingle_xmpp/xmllite/xmlelement.h"
_;
DeleteArg;
Return;
SaveArg;
namespace remoting::protocol {
namespace {
const int kMessageSize = …;
const int kMessages = …;
const char kNoClientId[] = …;
const char kNoPairedSecret[] = …;
const char kTestClientName[] = …;
const char kTestClientId[] = …;
const char kTestHostId[] = …;
const char kClientJid[] = …;
const char kHostJid[] = …;
const char kTestPairedSecret[] = …;
const char kTestPairedSecretBad[] = …;
const char kTestPin[] = …;
const char kTestPinBad[] = …;
}
class NegotiatingAuthenticatorTest : public AuthenticatorTestBase { … };
class NegotiatingPairingAuthenticatorTest
: public NegotiatingAuthenticatorTest { … };
TEST_F(NegotiatingAuthenticatorTest, SuccessfulAuthSharedSecret) { … }
TEST_F(NegotiatingAuthenticatorTest, InvalidSharedSecret) { … }
TEST_F(NegotiatingAuthenticatorTest, NoCommonAuthMethod) { … }
TEST_F(NegotiatingAuthenticatorTest, PairingNotSupported) { … }
TEST_F(NegotiatingPairingAuthenticatorTest, PairingSupportedButNotPaired) { … }
TEST_F(NegotiatingPairingAuthenticatorTest, PairingRevokedPinOkay) { … }
TEST_F(NegotiatingPairingAuthenticatorTest, PairingRevokedPinBad) { … }
TEST_F(NegotiatingPairingAuthenticatorTest, PairingSucceeded) { … }
TEST_F(NegotiatingPairingAuthenticatorTest,
PairingSucceededInvalidSecretButPinOkay) { … }
TEST_F(NegotiatingPairingAuthenticatorTest, PairingFailedInvalidSecretAndPin) { … }
TEST_F(NegotiatingAuthenticatorTest, NotifyStateChangeAfterAccepted) { … }
TEST_F(NegotiatingAuthenticatorTest,
ReturnCorrectCredentialsTypeAndImplementingAuthenticator) { … }
}