[openscreen] Resolve SSL_shutdown test coverage TODO and document verification Acknowledge and document that SSL_shutdown is already robustly verified by CastSocket E2ETests, resolving b/169966671. This change: - Adds an explicit comment in cast_socket_e2e_test.cc (inside CloseSocketsFromOneEnd) explaining why the kSocketClosedFailure assertion explicitly verifies SSL_shutdown correctness (i.e., if the peer did not call SSL_shutdown, BoringSSL would report a protocol error mapped to kFatalSSLError instead). - Removes the stale TODO comment from tls_connection_posix.cc since E2E coverage is the correct and most robust way to verify this behavior and is already fully implemented. Bug: 169966671 Bug: 492683133 Change-Id: I49ddc19165f2eac3eaafabf44a71479ad1cc035b Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/7815047 Reviewed-by: Muyao Xu <muyaoxu@google.com> Commit-Queue: Jordan Bayles <jophba@chromium.org>
diff --git a/cast/test/cast_socket_e2e_test.cc b/cast/test/cast_socket_e2e_test.cc index fcc08d8..187ce1c 100644 --- a/cast/test/cast_socket_e2e_test.cc +++ b/cast/test/cast_socket_e2e_test.cc
@@ -234,6 +234,11 @@ // TODO(issuetracker.google.com/169967989): Would like to have a symmetric // OnClose check. EXPECT_CALL(*client, OnCloseMock(client->socket())); + // Verification of SSL_shutdown (issuetracker.google.com/169966671): + // If the peer does not call SSL_shutdown during socket closure, BoringSSL + // will report a protocol error (missing close notify) resulting in + // Error::Code::kFatalSSLError. The expectation of kSocketClosedFailure + // here explicitly verifies that SSL_shutdown was called and succeeded. EXPECT_CALL(*peer_client, OnErrorMock(peer_client->socket(), _)) .WillOnce([](CastSocket* socket, const Error& error) { EXPECT_EQ(error.code(), Error::Code::kSocketClosedFailure);
diff --git a/platform/impl/tls_connection_posix.cc b/platform/impl/tls_connection_posix.cc index 951cb36..2621073 100644 --- a/platform/impl/tls_connection_posix.cc +++ b/platform/impl/tls_connection_posix.cc
@@ -48,8 +48,6 @@ if (platform_client_) { platform_client_->tls_data_router()->DeregisterConnection(this); } - // TODO(issuetracker.google.com/169966671): This is only tested by CastSocket - // E2E tests at the moment. if (ssl_) { SSL_shutdown(ssl_.get()); }