-rw-r--r-- | lib/sreg.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/sreg.cc b/lib/sreg.cc index b40cd45..0bd4d2e 100644 --- a/lib/sreg.cc +++ b/lib/sreg.cc | |||
@@ -42,38 +42,36 @@ namespace opkele { | |||
42 | } | 42 | } |
43 | string pfx = om.allocate_ns(OIURI_SREG11,"sreg"); | 43 | string pfx = om.allocate_ns(OIURI_SREG11,"sreg"); |
44 | if(!fr.empty()) om.set_field(pfx+".required",fr); | 44 | if(!fr.empty()) om.set_field(pfx+".required",fr); |
45 | if(!fo.empty()) om.set_field(pfx+".optional",fo); | 45 | if(!fo.empty()) om.set_field(pfx+".optional",fo); |
46 | if(!policy_url.empty()) om.set_field(pfx+".policy_url",policy_url); | 46 | if(!policy_url.empty()) om.set_field(pfx+".policy_url",policy_url); |
47 | } | 47 | } |
48 | 48 | ||
49 | void sreg_t::checkid_hook(basic_openid_message& om) { | 49 | void sreg_t::checkid_hook(basic_openid_message& om) { |
50 | rp_checkid_hook(om); } | 50 | rp_checkid_hook(om); } |
51 | 51 | ||
52 | void sreg_t::rp_id_res_hook(const basic_openid_message& om, | 52 | void sreg_t::rp_id_res_hook(const basic_openid_message& om, |
53 | const basic_openid_message& sp) { | 53 | const basic_openid_message& sp) { |
54 | clear(); | 54 | clear(); |
55 | string pfx; | 55 | string pfx; |
56 | try { | 56 | try { |
57 | pfx = om.find_ns(OIURI_SREG11,"sreg"); | 57 | pfx = om.find_ns(OIURI_SREG11,"sreg"); |
58 | }catch(failed_lookup& fl) { | 58 | }catch(failed_lookup&) { |
59 | try { | 59 | try { |
60 | pfx = om.find_ns(OIURI_SREG10,"sreg"); | 60 | pfx = om.find_ns(OIURI_SREG10,"sreg"); |
61 | }catch(failed_lookup& fl) { | 61 | }catch(failed_lookup&) { return; } |
62 | return; | ||
63 | } | ||
64 | } | 62 | } |
65 | pfx += '.'; | 63 | pfx += '.'; |
66 | for(fields_iterator f=fields_BEGIN;f<fields_END;++f) { | 64 | for(fields_iterator f=fields_BEGIN;f<fields_END;++f) { |
67 | string fn = pfx; fn+=f->fieldname; | 65 | string fn = pfx; fn+=f->fieldname; |
68 | if(!sp.has_field(fn)) continue; | 66 | if(!sp.has_field(fn)) continue; |
69 | has_fields |= f->fieldbit; | 67 | has_fields |= f->fieldbit; |
70 | response[f->fieldbit]=sp.get_field(fn); | 68 | response[f->fieldbit]=sp.get_field(fn); |
71 | } | 69 | } |
72 | } | 70 | } |
73 | 71 | ||
74 | void sreg_t::id_res_hook(const basic_openid_message& om, | 72 | void sreg_t::id_res_hook(const basic_openid_message& om, |
75 | const basic_openid_message& sp) { | 73 | const basic_openid_message& sp) { |
76 | rp_id_res_hook(om,sp); } | 74 | rp_id_res_hook(om,sp); } |
77 | 75 | ||
78 | const string& sreg_t::get_field(fieldbit_t fb) const { | 76 | const string& sreg_t::get_field(fieldbit_t fb) const { |
79 | response_t::const_iterator i = response.find(fb); | 77 | response_t::const_iterator i = response.find(fb); |