Index: remoting/host/security_key/gnubby_auth_handler.h |
diff --git a/remoting/host/security_key/gnubby_auth_handler.h b/remoting/host/security_key/gnubby_auth_handler.h |
index 0a6a7551300d7787ca47752bda4b7a1cf9a57d09..e95641a445c10598312121c8d1f6f83d6fd5fee5 100644 |
--- a/remoting/host/security_key/gnubby_auth_handler.h |
+++ b/remoting/host/security_key/gnubby_auth_handler.h |
@@ -5,6 +5,7 @@ |
#ifndef REMOTING_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ |
#define REMOTING_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ |
+#include <cstdint> |
#include <memory> |
#include <string> |
@@ -27,12 +28,17 @@ class GnubbyAuthHandler { |
typedef base::Callback<void(int connection_id, const std::string& data)> |
SendMessageCallback; |
+ // Returns the value of the current session being remoted. Used to ensure |
+ // global resources are only accessed from the remoted user session. |
+ typedef base::Callback<uint32_t()> SessionIdCallback; |
+ |
// Creates a platform-specific GnubbyAuthHandler. |
- // All invocations of |callback| are guaranteed to occur before the underlying |
- // GnubbyAuthHandler object is destroyed. It is not safe to destroy the |
- // GnubbyAuthHandler object within the callback. |
+ // All invocations of the callbacks are guaranteed to occur before the |
+ // underlying GnubbyAuthHandler object is destroyed. It is not safe to |
+ // destroy the GnubbyAuthHandler object within the callback. |
static std::unique_ptr<GnubbyAuthHandler> Create( |
- const SendMessageCallback& callback); |
+ const SendMessageCallback& send_message_callback, |
+ const SessionIdCallback& session_id_callback); |
Sergey Ulanov
2016/06/27 23:51:58
Why does the callback need to be passed to Create(
joedow
2016/06/28 01:27:34
The session ID can change at any time (e.g. when a
Sergey Ulanov
2016/06/28 18:08:03
Even if session ID may change it doesn't mean we n
joedow
2016/06/28 21:36:21
The host definitely knows when the session id is c
|
#if defined(OS_LINUX) |
// Specify the name of the socket to listen to gnubby requests on. |
@@ -42,6 +48,9 @@ class GnubbyAuthHandler { |
// Sets the callback used to send messages to the client. |
virtual void SetSendMessageCallback(const SendMessageCallback& callback) = 0; |
+ // Sets the callback used to retrieve the current session ID. |
+ virtual void SetSessionIdCallback(const SessionIdCallback& callback) = 0; |
+ |
// Creates the platform specific connection to handle gnubby requests. |
virtual void CreateGnubbyConnection() = 0; |