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

Side by Side Diff: net/socket/ssl_server_socket_unittest.cc

Issue 2418113002: Revert "Roll src/third_party/boringssl/src 0d81373f9..1991af690" (https://codereview.chromium.org/2… (Closed)
Patch Set: Created 4 years, 2 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 | « net/quic/chromium/quic_chromium_client_session.cc ('k') | net/ssl/ssl_cipher_suite_names.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 // This test suite uses SSLClientSocket to test the implementation of 5 // This test suite uses SSLClientSocket to test the implementation of
6 // SSLServerSocket. In order to establish connections between the sockets 6 // SSLServerSocket. In order to establish connections between the sockets
7 // we need two additional classes: 7 // we need two additional classes:
8 // 1. FakeSocket 8 // 1. FakeSocket
9 // Connects SSL socket to FakeDataChannel. This class is just a stub. 9 // Connects SSL socket to FakeDataChannel. This class is just a stub.
10 // 10 //
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 server_ret = handshake_callback.GetResult(server_ret); 542 server_ret = handshake_callback.GetResult(server_ret);
543 543
544 ASSERT_THAT(client_ret, IsOk()); 544 ASSERT_THAT(client_ret, IsOk());
545 ASSERT_THAT(server_ret, IsOk()); 545 ASSERT_THAT(server_ret, IsOk());
546 546
547 // Make sure the cert status is expected. 547 // Make sure the cert status is expected.
548 SSLInfo ssl_info; 548 SSLInfo ssl_info;
549 ASSERT_TRUE(client_socket_->GetSSLInfo(&ssl_info)); 549 ASSERT_TRUE(client_socket_->GetSSLInfo(&ssl_info));
550 EXPECT_EQ(CERT_STATUS_AUTHORITY_INVALID, ssl_info.cert_status); 550 EXPECT_EQ(CERT_STATUS_AUTHORITY_INVALID, ssl_info.cert_status);
551 551
552 // The default cipher suite should be ECDHE and an AEAD. 552 // The default cipher suite should be ECDHE and, unless on NSS and the
553 // platform doesn't support it, an AEAD.
553 uint16_t cipher_suite = 554 uint16_t cipher_suite =
554 SSLConnectionStatusToCipherSuite(ssl_info.connection_status); 555 SSLConnectionStatusToCipherSuite(ssl_info.connection_status);
555 const char* key_exchange; 556 const char* key_exchange;
556 const char* cipher; 557 const char* cipher;
557 const char* mac; 558 const char* mac;
558 bool is_aead; 559 bool is_aead;
559 bool is_tls13; 560 SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, cipher_suite);
560 SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, &is_tls13, 561 EXPECT_STREQ("ECDHE_RSA", key_exchange);
561 cipher_suite);
562 EXPECT_TRUE(is_aead); 562 EXPECT_TRUE(is_aead);
563 ASSERT_FALSE(is_tls13);
564 EXPECT_STREQ("ECDHE_RSA", key_exchange);
565 } 563 }
566 564
567 // This test makes sure the session cache is working. 565 // This test makes sure the session cache is working.
568 TEST_F(SSLServerSocketTest, HandshakeCached) { 566 TEST_F(SSLServerSocketTest, HandshakeCached) {
569 ASSERT_NO_FATAL_FAILURE(CreateContext()); 567 ASSERT_NO_FATAL_FAILURE(CreateContext());
570 ASSERT_NO_FATAL_FAILURE(CreateSockets()); 568 ASSERT_NO_FATAL_FAILURE(CreateSockets());
571 569
572 TestCompletionCallback handshake_callback; 570 TestCompletionCallback handshake_callback;
573 int server_ret = server_socket_->Handshake(handshake_callback.callback()); 571 int server_ret = server_socket_->Handshake(handshake_callback.callback());
574 572
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 int server_ret = server_socket_->Handshake(handshake_callback.callback()); 1112 int server_ret = server_socket_->Handshake(handshake_callback.callback());
1115 1113
1116 client_ret = connect_callback.GetResult(client_ret); 1114 client_ret = connect_callback.GetResult(client_ret);
1117 server_ret = handshake_callback.GetResult(server_ret); 1115 server_ret = handshake_callback.GetResult(server_ret);
1118 1116
1119 ASSERT_THAT(client_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); 1117 ASSERT_THAT(client_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH));
1120 ASSERT_THAT(server_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); 1118 ASSERT_THAT(server_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH));
1121 } 1119 }
1122 1120
1123 } // namespace net 1121 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session.cc ('k') | net/ssl/ssl_cipher_suite_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698