X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1ArtifactDecoder.cpp;h=23a95050ac532ead2af90adb31032dcdd9db7734;hb=3e40c0e62375c069e7860a87ca4f65fb2003f018;hp=83cd7ba49eb0feeee714873cc59c8f7faa8da95e;hpb=1bc8e721db3a50294df852662e1eddcdbdae8f9f;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp b/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp index 83cd7ba..23a9505 100644 --- a/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp @@ -50,9 +50,7 @@ namespace opensaml { SAML1ArtifactDecoder::SAML1ArtifactDecoder(const DOMElement* e) {} -SAML1ArtifactDecoder::~SAML1ArtifactDecoder() {} - -Response* SAML1ArtifactDecoder::decode( +XMLObject* SAML1ArtifactDecoder::decode( string& relayState, const GenericRequest& genericRequest, SecurityPolicy& policy @@ -125,6 +123,12 @@ Response* SAML1ArtifactDecoder::decode( auto_ptr_char issuer(provider->getEntityID()); log.debug("lookup succeeded, artifact issued by (%s)", issuer.get()); } + + // Mock up an Issuer object for the policy. + auto_ptr issuer(saml2::IssuerBuilder::buildIssuer()); + issuer->setName(provider->getEntityID()); + policy.setIssuer(issuer.get()); + issuer.release(); // owned by policy now log.debug("attempting to find artifact issuing role..."); const RoleDescriptor* roledesc=provider->getRoleDescriptor(*(policy.getRole()), samlconstants::SAML11_PROTOCOL_ENUM); @@ -133,23 +137,22 @@ Response* SAML1ArtifactDecoder::decode( if (!roledesc || !dynamic_cast(roledesc)) { log.error("unable to find compatible SAML role (%s) in metadata", policy.getRole()->toString().c_str()); for_each(artifacts.begin(), artifacts.end(), xmltooling::cleanup()); - BindingException ex("Unable to find compatible metadata role for artifact issuer."); - annotateException(&ex,provider); // throws it + throw BindingException("Unable to find compatible metadata role for artifact issuer."); } + policy.setIssuerMetadata(roledesc); try { auto_ptr response( m_artifactResolver->resolve(artifacts, dynamic_cast(*roledesc), policy) ); - policy.evaluate(genericRequest, *(response.get())); + policy.evaluate(*(response.get()), &genericRequest); for_each(artifacts.begin(), artifacts.end(), xmltooling::cleanup()); return response.release(); } - catch (XMLToolingException& ex) { + catch (XMLToolingException&) { for_each(artifacts.begin(), artifacts.end(), xmltooling::cleanup()); - annotateException(&ex,roledesc,false); throw; } }