X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1MessageRule.cpp;h=665b912c51e243c80b03aca3128a65dd370a3cc6;hb=0f6286d0ffd9371c187ecb1775cbd199ed051af5;hp=a022c11f01223df3c5a3de28a50054675818e54d;hpb=bf32f9265ac717ee1537ec442e5a2d54e169d486;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml1/binding/impl/SAML1MessageRule.cpp b/saml/saml1/binding/impl/SAML1MessageRule.cpp index a022c11..665b912 100644 --- a/saml/saml1/binding/impl/SAML1MessageRule.cpp +++ b/saml/saml1/binding/impl/SAML1MessageRule.cpp @@ -31,13 +31,13 @@ #include "saml2/metadata/MetadataProvider.h" #include "util/SAMLConstants.h" -#include +#include using namespace opensaml::saml2md; using namespace opensaml::saml1p; using namespace opensaml; +using namespace xmltooling::logging; using namespace xmltooling; -using namespace log4cpp; using namespace std; namespace opensaml { @@ -91,15 +91,8 @@ void SAML1MessageRule::evaluate(const XMLObject& message, const GenericRequest* a = assertions.front(); } - if (a && a->getIssuer()) { - if (!policy.getIssuer() || policy.getIssuer()->getFormat() || - !XMLString::equals(policy.getIssuer()->getName(), a->getIssuer())) { - // We either have a conflict, or a first-time set of Issuer. - auto_ptr issuer(saml2::IssuerBuilder::buildIssuer()); - issuer->setName(a->getIssuer()); - policy.setIssuer(issuer.get()); - issuer.release(); // owned by policy now - } + if (a) { + policy.setIssuer(a->getIssuer()); pair minor = a->getMinorVersion(); protocol = (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM; @@ -111,7 +104,7 @@ void SAML1MessageRule::evaluate(const XMLObject& message, const GenericRequest* } if (log.isDebugEnabled()) { - auto_ptr_char iname(policy.getIssuer()->getName()); + auto_ptr_char iname(a->getIssuer()); log.debug("message from (%s)", iname.get()); } @@ -122,9 +115,9 @@ void SAML1MessageRule::evaluate(const XMLObject& message, const GenericRequest* if (policy.getMetadataProvider() && policy.getRole()) { log.debug("searching metadata for message issuer..."); - const EntityDescriptor* entity = policy.getMetadataProvider()->getEntityDescriptor(policy.getIssuer()->getName()); + const EntityDescriptor* entity = policy.getMetadataProvider()->getEntityDescriptor(a->getIssuer()); if (!entity) { - auto_ptr_char temp(policy.getIssuer()->getName()); + auto_ptr_char temp(a->getIssuer()); log.warn("no metadata found, can't establish identity of issuer (%s)", temp.get()); return; }