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

Unified Diff: remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc

Issue 1739503003: Ignore host certificate in remoting::V2Authenticator on the client side. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.cc ('k') | remoting/protocol/v2_authenticator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc b/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
index 7688c166f52b65e53b7915f1e8aefc8dece85779..fbfdd00c442403cd1182bac53c01ba4ab5155035 100644
--- a/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
+++ b/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
@@ -152,10 +152,10 @@ class SslHmacChannelAuthenticatorTest : public testing::Test {
// Verify that a channel can be connected using a valid shared secret.
TEST_F(SslHmacChannelAuthenticatorTest, SuccessfulAuth) {
- client_auth_ = SslHmacChannelAuthenticator::CreateForClient(
- host_cert_, kTestSharedSecret);
- host_auth_ = SslHmacChannelAuthenticator::CreateForHost(
- host_cert_, key_pair_, kTestSharedSecret);
+ client_auth_ =
+ SslHmacChannelAuthenticator::CreateForClient(kTestSharedSecret);
+ host_auth_ = SslHmacChannelAuthenticator::CreateForHost(host_cert_, key_pair_,
+ kTestSharedSecret);
RunChannelAuth(net::OK, net::OK);
@@ -170,10 +170,10 @@ TEST_F(SslHmacChannelAuthenticatorTest, SuccessfulAuth) {
tester.CheckResults();
}
-// Verify that channels cannot be using invalid shared secret.
+// Verify that channels cannot be connected using invalid shared secret.
TEST_F(SslHmacChannelAuthenticatorTest, InvalidChannelSecret) {
- client_auth_ = SslHmacChannelAuthenticator::CreateForClient(
- host_cert_, kTestSharedSecretBad);
+ client_auth_ =
+ SslHmacChannelAuthenticator::CreateForClient(kTestSharedSecretBad);
host_auth_ = SslHmacChannelAuthenticator::CreateForHost(
host_cert_, key_pair_, kTestSharedSecret);
@@ -182,24 +182,5 @@ TEST_F(SslHmacChannelAuthenticatorTest, InvalidChannelSecret) {
ASSERT_TRUE(host_socket_.get() == nullptr);
}
-// Verify that channels cannot be using invalid certificate.
-TEST_F(SslHmacChannelAuthenticatorTest, InvalidCertificate) {
- // Import a second certificate for the client to expect.
- scoped_refptr<net::X509Certificate> host_cert2(
- net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"));
- std::string host_cert2_der;
- ASSERT_TRUE(net::X509Certificate::GetDEREncoded(host_cert2->os_cert_handle(),
- &host_cert2_der));
-
- client_auth_ = SslHmacChannelAuthenticator::CreateForClient(
- host_cert2_der, kTestSharedSecret);
- host_auth_ = SslHmacChannelAuthenticator::CreateForHost(
- host_cert_, key_pair_, kTestSharedSecret);
-
- RunChannelAuth(net::ERR_CERT_INVALID, net::ERR_CONNECTION_CLOSED);
-
- ASSERT_TRUE(host_socket_.get() == nullptr);
-}
-
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.cc ('k') | remoting/protocol/v2_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698