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

Unified Diff: remoting/host/security_key/security_key_ipc_client.cc

Issue 2575963002: Handle Security Key requests from outside the remoted session correctly (Closed)
Patch Set: Addressing CR Feedback Created 4 years 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
Index: remoting/host/security_key/security_key_ipc_client.cc
diff --git a/remoting/host/security_key/security_key_ipc_client.cc b/remoting/host/security_key/security_key_ipc_client.cc
index 43ad72f17b8e735bbd61efd24a502e1f3e6c7e6d..994f92ef231005319d07bba22c8a3451d94f294a 100644
--- a/remoting/host/security_key/security_key_ipc_client.cc
+++ b/remoting/host/security_key/security_key_ipc_client.cc
@@ -38,14 +38,14 @@ bool SecurityKeyIpcClient::CheckForSecurityKeyIpcServerChannel() {
}
void SecurityKeyIpcClient::EstablishIpcConnection(
- const base::Closure& connection_ready_callback,
+ const ConnectedCallback& connected_callback,
const base::Closure& connection_error_callback) {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(!connection_ready_callback.is_null());
+ DCHECK(!connected_callback.is_null());
DCHECK(!connection_error_callback.is_null());
DCHECK(!ipc_channel_);
- connection_ready_callback_ = connection_ready_callback;
+ connected_callback_ = connected_callback;
connection_error_callback_ = connection_error_callback;
ConnectToIpcChannel();
@@ -96,6 +96,10 @@ bool SecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(SecurityKeyIpcClient, message)
IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_Response,
OnSecurityKeyResponse)
+ IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionReady,
+ OnConnectionReady)
+ IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_InvalidSession,
+ OnInvalidSession)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -122,8 +126,6 @@ void SecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) {
return;
}
#endif // defined(OS_WIN)
-
- base::ResetAndReturn(&connection_ready_callback_).Run();
}
void SecurityKeyIpcClient::OnChannelError() {
@@ -147,6 +149,20 @@ void SecurityKeyIpcClient::OnSecurityKeyResponse(
}
}
+void SecurityKeyIpcClient::OnConnectionReady() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(!connected_callback_.is_null());
dcheng 2016/12/16 02:33:07 Just to double-check: is the server end (the one s
joedow 2016/12/16 03:36:22 The server in this context is our network process
dcheng 2016/12/16 09:12:03 It's hard for me to tell if the network service is
joedow 2016/12/16 16:20:18 The network process is a low-integrity process. I
+
+ base::ResetAndReturn(&connected_callback_).Run(/*connection_usable=*/true);
+}
+
+void SecurityKeyIpcClient::OnInvalidSession() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(!connected_callback_.is_null());
+
+ base::ResetAndReturn(&connected_callback_).Run(/*connection_usable=*/false);
+}
+
void SecurityKeyIpcClient::ConnectToIpcChannel() {
DCHECK(thread_checker_.CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698