summaryrefslogtreecommitdiffabout
path: root/lib/consumer.cc
authorMichael Krelin <hacker@klever.net>2007-08-09 11:23:36 (UTC)
committer Michael Krelin <hacker@klever.net>2007-08-09 11:23:36 (UTC)
commit65bab7c9f984d6fe45ce72e7db014c40eba4d240 (patch) (unidiff)
tree28c4791aea6b7dc404ad0d27050c34f447a84314 /lib/consumer.cc
parent1f347795ef5eba50892fd777c173a2a6db1755f2 (diff)
downloadlibopkele-65bab7c9f984d6fe45ce72e7db014c40eba4d240.zip
libopkele-65bab7c9f984d6fe45ce72e7db014c40eba4d240.tar.gz
libopkele-65bab7c9f984d6fe45ce72e7db014c40eba4d240.tar.bz2
associations robustness improvements and documentation updates
Diffstat (limited to 'lib/consumer.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/consumer.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc
index dd8e150..af309c1 100644
--- a/lib/consumer.cc
+++ b/lib/consumer.cc
@@ -144,6 +144,8 @@ namespace opkele {
144 p["return_to"] = return_to; 144 p["return_to"] = return_to;
145 try { 145 try {
146 string ah = find_assoc(server)->handle(); 146 string ah = find_assoc(server)->handle();
147 if(ah->is_expired()) /* TODO: or should I throw some other exception to force programmer fix his implementation? */
148 throw failed_lookup(OPKELE_CP_ "find_assoc() has returned expired handle");
147 p["assoc_handle"] = ah; 149 p["assoc_handle"] = ah;
148 }catch(failed_lookup& fl) { 150 }catch(failed_lookup& fl) {
149 string ah = associate(server)->handle(); 151 string ah = associate(server)->handle();
@@ -161,6 +163,8 @@ namespace opkele {
161 params_t ps; 163 params_t ps;
162 try { 164 try {
163 assoc_t assoc = retrieve_assoc(server,pin.get_param("openid.assoc_handle")); 165 assoc_t assoc = retrieve_assoc(server,pin.get_param("openid.assoc_handle"));
166 if(assoc->is_expired()) /* TODO: or should I throw some other exception to force programmer fix his implementation? */
167 throw failed_lookup(OPKELE_CP_ "retrieve_assoc() has returned expired handle");
164 const string& sigenc = pin.get_param("openid.sig"); 168 const string& sigenc = pin.get_param("openid.sig");
165 vector<unsigned char> sig; 169 vector<unsigned char> sig;
166 util::decode_base64(sigenc,sig); 170 util::decode_base64(sigenc,sig);