Add code for non-covariant build.
[shibboleth/cpp-opensaml.git] / saml / saml2 / binding / impl / SAML2POSTDecoder.cpp
index a7f1cda..ebb2ec2 100644 (file)
@@ -52,9 +52,7 @@ namespace opensaml {
 
 SAML2POSTDecoder::SAML2POSTDecoder(const DOMElement* e) {}
 
-SAML2POSTDecoder::~SAML2POSTDecoder() {}
-
-saml2::RootObject* SAML2POSTDecoder::decode(
+XMLObject* SAML2POSTDecoder::decode(
     std::string& relayState,
     const GenericRequest& genericRequest,
     SecurityPolicy& policy
@@ -120,7 +118,7 @@ saml2::RootObject* SAML2POSTDecoder::decode(
         // Check destination URL.
         auto_ptr_char dest(request ? request->getDestination() : response->getDestination());
         const char* dest2 = httpRequest->getRequestURL();
-        if (root->getSignature() && !dest.get() || !*(dest.get())) {
+        if ((root->getSignature() || httpRequest->getParameter("Signature")) && !dest.get() || !*(dest.get())) {
             log.error("signed SAML message missing Destination attribute");
             throw BindingException("Signed SAML message missing Destination attribute identifying intended destination.");
         }
@@ -130,7 +128,7 @@ saml2::RootObject* SAML2POSTDecoder::decode(
         }
         
         // Run through the policy.
-        policy.evaluate(genericRequest, *response);
+        policy.evaluate(genericRequest, *root);
     }
     catch (XMLToolingException& ex) {
         // This is just to maximize the likelihood of attaching a source to the message for support purposes.