author | Michael Krelin <hacker@klever.net> | 2008-01-30 00:01:32 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-01-30 00:01:32 (UTC) |
commit | 66b14d4368d661daf2248e36ac4f9a3f69f6a75a (patch) (side-by-side diff) | |
tree | 01bfef4ebeb4cd52f628a598a709a8adde971305 /include/opkele | |
parent | dc5dad0709ae8dd0a4be74248a22a78e47ba90e2 (diff) | |
download | libopkele-66b14d4368d661daf2248e36ac4f9a3f69f6a75a.zip libopkele-66b14d4368d661daf2248e36ac4f9a3f69f6a75a.tar.gz libopkele-66b14d4368d661daf2248e36ac4f9a3f69f6a75a.tar.bz2 |
a few changes to the infrastructure
* added mode_unknown to the mode_t enumeration
* add to_keyvalues(ostream&) to openid message class
* fixed openid_message_t::set_field for the case of overwriting
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/types.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/opkele/types.h b/include/opkele/types.h index d5ad258..842a722 100644 --- a/include/opkele/types.h +++ b/include/opkele/types.h @@ -17,32 +17,33 @@ namespace opkele { using std::vector; using std::string; using std::map; using std::ostream; using std::multimap; using std::set; using std::list; using std::iterator; using std::forward_iterator_tag; /** * the OpenID operation mode */ typedef enum _mode_t { + mode_unknown = 0, mode_associate, mode_checkid_immediate, mode_checkid_setup, mode_check_association } mode_t; /** * the association secret container */ class secret_t : public vector<unsigned char> { public: /** * xor the secret and hmac together and encode, using base64 * @param key_d pointer to the message digest * @param rv reference to the return value @@ -132,32 +133,33 @@ namespace opkele { virtual bool has_ns(const string& uri) const; virtual string get_ns(const string& uri) const; virtual fields_iterator fields_begin() const = 0; virtual fields_iterator fields_end() const = 0; virtual string append_query(const string& url) const; virtual string query_string() const; virtual void reset_fields(); virtual void set_field(const string& n,const string& v); virtual void reset_field(const string& n); virtual void from_keyvalues(const string& kv); + virtual void to_keyvalues(ostream& o) const; void add_to_signed(const string& fields); string find_ns(const string& uri,const char *pfx) const; string allocate_ns(const string& uri,const char *pfx); }; class openid_message_t : public basic_openid_message, public map<string,string> { public: openid_message_t() { } openid_message_t(const basic_openid_message& x) : basic_openid_message(x) { } void copy_to(basic_openid_message& x) const; bool has_field(const string& n) const; const string& get_field(const string& n) const; |