Chromium Code Reviews| Index: remoting/protocol/authentication_method.h |
| diff --git a/remoting/protocol/authentication_method.h b/remoting/protocol/authentication_method.h |
| index 95a27e07a10c48e646640ca089d0e215e4ae1c9f..6d72b983836921c3fe9cd9ed90f8553ef8218fc3 100644 |
| --- a/remoting/protocol/authentication_method.h |
| +++ b/remoting/protocol/authentication_method.h |
| @@ -21,6 +21,12 @@ class Authenticator; |
| class AuthenticationMethod { |
| public: |
| + enum MethodType { |
| + INVALID, |
| + SPAKE2, |
| + THIRD_PARTY |
| + }; |
| + |
| enum HashFunction { |
|
Wez
2013/03/22 06:17:01
Given that HashFunction only applies to SPAKE2, wh
rmsousa
2013/03/22 21:19:05
There are some explicit uses of the hashfunction e
|
| NONE, |
| HMAC_SHA256, |
| @@ -29,6 +35,7 @@ class AuthenticationMethod { |
| // Constructors for various authentication methods. |
| static AuthenticationMethod Invalid(); |
| static AuthenticationMethod Spake2(HashFunction hash_function); |
| + static AuthenticationMethod ThirdParty(); |
| // Parses a string that defines an authentication method. Returns an |
| // invalid value if the string is invalid. |
| @@ -40,8 +47,9 @@ class AuthenticationMethod { |
| const std::string& tag, |
| const std::string& shared_secret); |
| - // Returns true |
| - bool is_valid() const { return !invalid_; } |
| + bool is_valid() const { return method_type_ != INVALID; } |
| + |
| + MethodType method_type() const { return method_type_; } |
| // Following methods are valid only when is_valid() returns true. |
| @@ -58,11 +66,11 @@ class AuthenticationMethod { |
| return !(*this == other); |
| } |
| - private: |
| + protected: |
| AuthenticationMethod(); |
| - explicit AuthenticationMethod(HashFunction hash_function); |
| + AuthenticationMethod(MethodType method_type, HashFunction hash_function); |
| - bool invalid_; |
| + MethodType method_type_; |
|
Sergey Ulanov
2013/03/22 05:58:43
nit: type_
rmsousa
2013/03/22 21:19:05
Done.
|
| HashFunction hash_function_; |
| }; |