OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // AuthenticationMethod represents an authentication algorithm and its | 5 // AuthenticationMethod represents an authentication algorithm and its |
6 // configuration. It knows how to parse and format authentication | 6 // configuration. It knows how to parse and format authentication |
7 // method names. | 7 // method names. |
8 // Currently the following methods are supported: | 8 // Currently the following methods are supported: |
9 // v1_token - deprecated V1 authentication mechanism, | 9 // v1_token - deprecated V1 authentication mechanism, |
10 // spake2_plain - SPAKE2 without hashing applied to the password. | 10 // spake2_plain - SPAKE2 without hashing applied to the password. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 private: | 64 private: |
65 AuthenticationMethod(); | 65 AuthenticationMethod(); |
66 AuthenticationMethod(HashFunction hash_function); | 66 AuthenticationMethod(HashFunction hash_function); |
67 | 67 |
68 bool invalid_; | 68 bool invalid_; |
69 HashFunction hash_function_; | 69 HashFunction hash_function_; |
70 }; | 70 }; |
71 | 71 |
| 72 // SharedSecretHash stores hash of a host secret paired with the type |
| 73 // of the hashing function. |
| 74 struct SharedSecretHash { |
| 75 AuthenticationMethod::HashFunction hash_function; |
| 76 std::string value; |
| 77 |
| 78 // Parse string representation of a shared secret hash. The |as_string| |
| 79 // must be in form "<hash_function>:<hash_value_base64>". |
| 80 bool Parse(const std::string& as_string); |
| 81 }; |
| 82 |
72 } // namespace protocol | 83 } // namespace protocol |
73 } // namespace remoting | 84 } // namespace remoting |
74 | 85 |
75 #endif // REMOTING_PROTOCOL_AUTHENTICATION_METHOD_H_ | 86 #endif // REMOTING_PROTOCOL_AUTHENTICATION_METHOD_H_ |
OLD | NEW |