Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2310)

Unified Diff: remoting/protocol/authentication_method.h

Issue 12326090: Third Party authentication protocol. (Closed) Base URL: http://git.chromium.org/chromium/src.git@host_key_pair
Patch Set: Reviewer comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
};
« no previous file with comments | « no previous file | remoting/protocol/authentication_method.cc » ('j') | remoting/protocol/authentication_method.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698