| Index: remoting/protocol/authentication_method.h
|
| diff --git a/remoting/protocol/authentication_method.h b/remoting/protocol/authentication_method.h
|
| index 95a27e07a10c48e646640ca089d0e215e4ae1c9f..df7937b0fb269c7f81a9dd0660d92935ce623fd9 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 {
|
| 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 type_ != INVALID; }
|
| +
|
| + MethodType type() const { return 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 type, HashFunction hash_function);
|
|
|
| - bool invalid_;
|
| + MethodType type_;
|
| HashFunction hash_function_;
|
| };
|
|
|
|
|