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/support_access_verifier.h" | 5 #include "remoting/host/support_access_verifier.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "remoting/host/host_config.h" | 13 #include "remoting/host/host_config.h" |
14 #include "remoting/protocol/auth_token_utils.h" | 14 #include "remoting/protocol/auth_util.h" |
15 | 15 |
16 namespace remoting { | 16 namespace remoting { |
17 | 17 |
18 namespace { | 18 namespace { |
19 // 5 digits means 100K possible host secrets with uniform distribution, which | 19 // 5 digits means 100K possible host secrets with uniform distribution, which |
20 // should be enough for short-term passwords, given that we rate-limit guesses | 20 // should be enough for short-term passwords, given that we rate-limit guesses |
21 // in the cloud and expire access codes after a small number of attempts. | 21 // in the cloud and expire access codes after a small number of attempts. |
22 const int kHostSecretLength = 5; | 22 const int kHostSecretLength = 5; |
23 const char kHostSecretAlphabet[] = "0123456789"; | 23 const char kHostSecretAlphabet[] = "0123456789"; |
24 | 24 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void SupportAccessVerifier::OnIT2MeHostRegistered( | 60 void SupportAccessVerifier::OnIT2MeHostRegistered( |
61 bool successful, const std::string& support_id) { | 61 bool successful, const std::string& support_id) { |
62 if (successful) { | 62 if (successful) { |
63 support_id_ = support_id; | 63 support_id_ = support_id; |
64 } else { | 64 } else { |
65 LOG(ERROR) << "Failed to register support host"; | 65 LOG(ERROR) << "Failed to register support host"; |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 } // namespace remoting | 69 } // namespace remoting |
OLD | NEW |