summaryrefslogtreecommitdiffabout
path: root/lib/server.cc
authorMichael Krelin <hacker@klever.net>2007-11-21 18:24:28 (UTC)
committer Michael Krelin <hacker@klever.net>2007-11-21 18:24:28 (UTC)
commit6d455b3ce69e62bdbe7ca894bc2cacac3e793a99 (patch) (side-by-side diff)
tree38c3cd9b588dfebb6b459c3ca6b927757667f22a /lib/server.cc
parenta9b6c1f0b1a771dcd9afc76f05d1ad2ff0af937e (diff)
downloadlibopkele-6d455b3ce69e62bdbe7ca894bc2cacac3e793a99.zip
libopkele-6d455b3ce69e62bdbe7ca894bc2cacac3e793a99.tar.gz
libopkele-6d455b3ce69e62bdbe7ca894bc2cacac3e793a99.tar.bz2
keep compiler happy about shadowed variable
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'lib/server.cc') (more/less context) (show whitespace changes)
-rw-r--r--lib/server.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/server.cc b/lib/server.cc
index aa61035..282521e 100644
--- a/lib/server.cc
+++ b/lib/server.cc
@@ -116,56 +116,56 @@ namespace opkele {
vector<unsigned char> sig;
const string& sigenc = pin.get_param("openid.sig");
util::decode_base64(sigenc,sig);
assoc_t assoc;
try {
assoc = retrieve_assoc(pin.get_param("openid.assoc_handle"));
}catch(failed_lookup& fl) {
throw failed_assertion(OPKELE_CP_ "invalid handle or handle not specified");
}
if(!assoc->stateless())
throw stateful_handle(OPKELE_CP_ "will not do check_authentication on a stateful handle");
const string& slist = pin.get_param("openid.signed");
string kv;
string::size_type p =0;
while(true) {
string::size_type co = slist.find(',',p);
string f = (co==string::npos)?slist.substr(p):slist.substr(p,co-p);
kv += f;
kv += ':';
if(f=="mode")
kv += "id_res";
else {
f.insert(0,"openid.");
kv += pin.get_param(f);
}
kv += '\n';
if(co==string::npos)
break;
p = co+1;
}
secret_t secret = assoc->secret();
unsigned int md_len = 0;
unsigned char *md = HMAC(
EVP_sha1(),
&(secret.front()),secret.size(),
(const unsigned char *)kv.data(),kv.length(),
0,&md_len);
pout.clear();
if(sig.size()==md_len && !memcmp(&(sig.front()),md,md_len)) {
pout["is_valid"]="true";
pout["lifetime"]="60"; /* TODO: eventually remove deprecated stuff */
}else{
pout["is_valid"]="false";
pout["lifetime"]="0"; /* TODO: eventually remove deprecated stuff */
}
if(pin.has_param("openid.invalidate_handle")) {
string h = pin.get_param("openid.invalidate_handle");
try {
- assoc_t assoc = retrieve_assoc(h);
+ assoc_t tmp = retrieve_assoc(h);
}catch(invalid_handle& ih) {
pout["invalidate_handle"] = h;
}catch(failed_lookup& fl) { }
}
}
}