X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fbinding%2Fimpl%2FXMLSigningRule.cpp;h=d667cfd91539bb1578c7fc30de777b78f12fcfd0;hb=f753e2293ab6a40575bc9b294490e134eac5db9e;hp=cad0e6d32631f5ca4215a9454a84354423dc3a71;hpb=9e5f5fd6b4d0dfd3cb062e98dcb087640bf82414;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/binding/impl/XMLSigningRule.cpp b/saml/binding/impl/XMLSigningRule.cpp index cad0e6d..d667cfd 100644 --- a/saml/binding/impl/XMLSigningRule.cpp +++ b/saml/binding/impl/XMLSigningRule.cpp @@ -22,7 +22,6 @@ #include "internal.h" #include "exceptions.h" -#include "RootObject.h" #include "binding/XMLSigningRule.h" #include "saml1/core/Assertions.h" #include "saml1/core/Protocols.h" @@ -48,7 +47,7 @@ namespace opensaml { } }; -pair XMLSigningRule::evaluate( +pair XMLSigningRule::evaluate( const GenericRequest& request, const XMLObject& message, const MetadataProvider* metadataProvider, @@ -67,9 +66,9 @@ pair XMLSigningRule::evaluate( } try { - const RootObject& root = dynamic_cast(message); - if (!root.getSignature()) { - log.debug("ignoring unsigned message"); + const SignableObject* signable = dynamic_cast(&message); + if (!signable || !signable->getSignature()) { + log.debug("ignoring unsigned or unrecognized message"); return ret; } @@ -91,14 +90,14 @@ pair XMLSigningRule::evaluate( return ret; } - log.debug("matched assertion issuer against metadata, searching for applicable role..."); + log.debug("matched message issuer against metadata, searching for applicable role..."); const RoleDescriptor* roledesc=entity->getRoleDescriptor(*role, issuerInfo.second); if (!roledesc) { log.warn("unable to find compatible role (%s) in metadata", role->toString().c_str()); return ret; } - if (!trustEngine->validate(*(root.getSignature()), *roledesc, metadataProvider->getKeyResolver())) { + if (!trustEngine->validate(*(signable->getSignature()), *roledesc, metadataProvider->getKeyResolver())) { log.error("unable to verify signature on message with supplied trust engine"); return ret; } @@ -159,19 +158,6 @@ pair XMLSigningRule::getIssuerAndProtocol(const XML } } } - else if (XMLString::equals(ns, samlconstants::SAML1_NS)) { - // Should be a saml:Assertion. - const saml1::Assertion& a = dynamic_cast(message); - if (a.getIssuer()) { - issuer = saml2::IssuerBuilder::buildIssuer(); - issuer->setName(a.getIssuer()); - pair minor = a.getMinorVersion(); - return make_pair( - issuer, - (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM - ); - } - } } return pair(NULL,NULL); }