X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1MessageRule.cpp;h=c821225376f648524ec381fb23de31eec6a8fa9d;hp=3d70d87a6607e6fe195778324ca198c7b1083c9a;hb=632fdee22ac4b756eaa3158217b9acd6c831e7be;hpb=3e40c0e62375c069e7860a87ca4f65fb2003f018 diff --git a/saml/saml1/binding/impl/SAML1MessageRule.cpp b/saml/saml1/binding/impl/SAML1MessageRule.cpp index 3d70d87..c821225 100644 --- a/saml/saml1/binding/impl/SAML1MessageRule.cpp +++ b/saml/saml1/binding/impl/SAML1MessageRule.cpp @@ -47,7 +47,7 @@ namespace opensaml { } }; -void SAML1MessageRule::evaluate(const XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const +bool SAML1MessageRule::evaluate(const XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const { Category& log=Category::getInstance(SAML_LOGCAT".SecurityPolicyRule.SAML1Message"); @@ -87,7 +87,7 @@ void SAML1MessageRule::evaluate(const XMLObject& message, const GenericRequest* if (!protocol) { log.warn("issuer identity not extracted"); - return; + return false; } if (log.isDebugEnabled()) { @@ -101,20 +101,23 @@ void SAML1MessageRule::evaluate(const XMLObject& message, const GenericRequest* if (!entity) { auto_ptr_char temp(policy.getIssuer()->getName()); log.warn("no metadata found, can't establish identity of issuer (%s)", temp.get()); - return; + return false; } log.debug("matched message issuer against metadata, searching for applicable role..."); const RoleDescriptor* roledesc=entity->getRoleDescriptor(*policy.getRole(), protocol); if (!roledesc) { log.warn("unable to find compatible role (%s) in metadata", policy.getRole()->toString().c_str()); - return; + return false; } policy.setIssuerMetadata(roledesc); + return true; } } catch (bad_cast&) { // Just trap it. log.warn("caught a bad_cast while examining message"); } + + return false; }