| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "remoting/host/self_access_verifier.h" | 5 #include "remoting/host/self_access_verifier.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "remoting/host/host_config.h" | 9 #include "remoting/host/host_config.h" |
| 10 #include "remoting/proto/auth.pb.h" | |
| 11 | 10 |
| 12 namespace remoting { | 11 namespace remoting { |
| 13 | 12 |
| 14 SelfAccessVerifier::SelfAccessVerifier() | 13 SelfAccessVerifier::SelfAccessVerifier() |
| 15 : initialized_(false) { | 14 : initialized_(false) { |
| 16 } | 15 } |
| 17 | 16 |
| 18 SelfAccessVerifier::~SelfAccessVerifier() { } | 17 SelfAccessVerifier::~SelfAccessVerifier() { } |
| 19 | 18 |
| 20 bool SelfAccessVerifier::Init(HostConfig* config) { | 19 bool SelfAccessVerifier::Init(HostConfig* config) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 } | 43 } |
| 45 | 44 |
| 46 // Check that the client has the same bare jid as the host, i.e. | 45 // Check that the client has the same bare jid as the host, i.e. |
| 47 // client's full JID starts with host's bare jid. Comparison is case | 46 // client's full JID starts with host's bare jid. Comparison is case |
| 48 // insensitive. | 47 // insensitive. |
| 49 if (!StartsWithASCII(client_jid, host_jid_prefix_, false)) { | 48 if (!StartsWithASCII(client_jid, host_jid_prefix_, false)) { |
| 50 LOG(ERROR) << "Rejecting incoming connection from " << client_jid; | 49 LOG(ERROR) << "Rejecting incoming connection from " << client_jid; |
| 51 return false; | 50 return false; |
| 52 } | 51 } |
| 53 | 52 |
| 54 // Decode the auth token. | |
| 55 protocol::ClientAuthToken client_token; | |
| 56 if (!DecodeClientAuthToken(encoded_access_token, &client_token)) { | |
| 57 return false; | |
| 58 } | |
| 59 | |
| 60 // Kick off directory access permissions. | 53 // Kick off directory access permissions. |
| 61 // TODO(ajwong): Actually implement this. | 54 // TODO(ajwong): Actually implement this. |
| 62 return true; | 55 return true; |
| 63 } | 56 } |
| 64 | 57 |
| 65 bool SelfAccessVerifier::DecodeClientAuthToken( | |
| 66 const std::string& encoded_client_token, | |
| 67 protocol::ClientAuthToken* client_token) { | |
| 68 // TODO(ajwong): Implement this. | |
| 69 NOTIMPLEMENTED(); | |
| 70 return true; | |
| 71 } | |
| 72 | |
| 73 } // namespace remoting | 58 } // namespace remoting |
| OLD | NEW |