-rw-r--r-- | lib/consumer.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc index 10c2fa0..b215aa8 100644 --- a/lib/consumer.cc +++ b/lib/consumer.cc @@ -169,33 +169,33 @@ namespace opkele { mimetic::Base64::Decoder b; vector<unsigned char> sig; mimetic::decode( sigenc.begin(),sigenc.end(), b, back_insert_iterator<vector<unsigned char> >(sig) ); 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 += ':'; f.insert(0,"openid."); kv += pin.get_param(f); kv += '\n'; - if(ext) ps[f.substr(sizeof("openid."))] = pin.get_param(f); + if(ext) ps[f.substr(sizeof("openid.")-1)] = pin.get_param(f); 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); if(sig.size()!=md_len || memcmp(&(sig.front()),md,md_len)) throw id_res_mismatch(OPKELE_CP_ "signature mismatch"); }catch(failed_lookup& e) { /* XXX: more specific? */ const string& slist = pin.get_param("openid.signed"); string::size_type pp = 0; |