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

Issue 2589933002: Updating SecurityKeyAuthHandlerPosix socket lifetime management (Closed)

Created:
4 years ago by joedow
Modified:
4 years ago
Reviewers:
Sergey Ulanov
CC:
chromium-reviews, chromoting-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Updating SecurityKeyAuthHandlerPosix socket lifetime management This change fixes two problems: 1.) Security key responses would not be delivered if the read end of the socket was closed before the response was received. This should be allowed since the write end was still open. 2.) An SSH error was always written when the socket was closed. This was misleading when no error occrred and the socket was being closed for a valid reason. The old behavior would close the socket as soon as a read returned 0 bytes (or an error). The auth handler would read a request and forward it to the remote machine, then immediately try to read another request. If the code on the other end had closed its side of the connection, the auth handler would receive EOF and close the socket. It would also write an error to the write end of the socket which was also wrong. The simpler change is to only write an error if the request timed out or if we encountered a socket read error. Otherwise we just close our end of the socket and the listener receives an EOF. The bigger change is that we no longer queue up another socket read operation until after we have received the response from the remote machine. The SecurityKeySocket is meant to receive and respond to one request at a time (per its class comments), and this new behavior also makes lifetime management of the socket less complex. BUG=671041 Committed: https://crrev.com/cb5a2ea87efd87a693c43a79cd1bde92a91b78cd Cr-Commit-Position: refs/heads/master@{#439675}

Patch Set 1 #

Patch Set 2 : Updating some additional unit tests #

Patch Set 3 : Prereview tweaks #

Total comments: 9

Patch Set 4 : Addressing CR feedback #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -34 lines) Patch
M remoting/host/security_key/security_key_auth_handler_posix.cc View 1 2 3 6 chunks +17 lines, -10 lines 0 comments Download
M remoting/host/security_key/security_key_auth_handler_posix_unittest.cc View 1 2 15 chunks +71 lines, -14 lines 0 comments Download
M remoting/host/security_key/security_key_socket.h View 2 chunks +7 lines, -3 lines 0 comments Download
M remoting/host/security_key/security_key_socket.cc View 1 2 3 4 chunks +10 lines, -7 lines 2 comments Download

Messages

Total messages: 21 (13 generated)
joedow
PTAL!
4 years ago (2016-12-19 20:50:25 UTC) #4
Sergey Ulanov
https://codereview.chromium.org/2589933002/diff/40001/remoting/host/security_key/security_key_auth_handler_posix.cc File remoting/host/security_key/security_key_auth_handler_posix.cc (right): https://codereview.chromium.org/2589933002/diff/40001/remoting/host/security_key/security_key_auth_handler_posix.cc#newcode205 remoting/host/security_key/security_key_auth_handler_posix.cc:205: HOST_LOG << "Sending client response to socket: " << ...
4 years ago (2016-12-19 23:19:18 UTC) #7
joedow
Updated based on feedback, PTAL! https://codereview.chromium.org/2589933002/diff/40001/remoting/host/security_key/security_key_auth_handler_posix.cc File remoting/host/security_key/security_key_auth_handler_posix.cc (right): https://codereview.chromium.org/2589933002/diff/40001/remoting/host/security_key/security_key_auth_handler_posix.cc#newcode205 remoting/host/security_key/security_key_auth_handler_posix.cc:205: HOST_LOG << "Sending client ...
4 years ago (2016-12-20 00:28:00 UTC) #10
Sergey Ulanov
lgtm https://codereview.chromium.org/2589933002/diff/60001/remoting/host/security_key/security_key_socket.cc File remoting/host/security_key/security_key_socket.cc (right): https://codereview.chromium.org/2589933002/diff/60001/remoting/host/security_key/security_key_socket.cc#newcode134 remoting/host/security_key/security_key_socket.cc:134: // determine the request length and only read ...
4 years ago (2016-12-20 00:54:23 UTC) #11
joedow
Thanks! https://codereview.chromium.org/2589933002/diff/60001/remoting/host/security_key/security_key_socket.cc File remoting/host/security_key/security_key_socket.cc (right): https://codereview.chromium.org/2589933002/diff/60001/remoting/host/security_key/security_key_socket.cc#newcode134 remoting/host/security_key/security_key_socket.cc:134: // determine the request length and only read ...
4 years ago (2016-12-20 02:24:03 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2589933002/60001
4 years ago (2016-12-20 02:24:37 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-12-20 02:29:23 UTC) #19
commit-bot: I haz the power
4 years ago (2016-12-20 02:31:41 UTC) #21
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/cb5a2ea87efd87a693c43a79cd1bde92a91b78cd
Cr-Commit-Position: refs/heads/master@{#439675}

Powered by Google App Engine
This is Rietveld 408576698