Imported Upstream version 2.4+dfsg
[shibboleth/sp.git] / shibsp / binding / impl / ArtifactResolver.cpp
index 52e68fc..d05e00a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2010 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "internal.h"
 #include "Application.h"
-#include "exceptions.h"
 #include "binding/ArtifactResolver.h"
 #include "binding/SOAPClient.h"
 #include "security/SecurityPolicy.h"
 
+#include <saml/exceptions.h>
 #include <saml/saml1/core/Protocols.h>
 #include <saml/saml1/binding/SAML1SOAPClient.h>
 #include <saml/saml2/core/Protocols.h>
 #include <saml/saml2/binding/SAML2Artifact.h>
 #include <saml/saml2/binding/SAML2SOAPClient.h>
+#include <saml/saml2/metadata/Metadata.h>
 #include <saml/saml2/metadata/MetadataCredentialCriteria.h>
 #include <saml/util/SAMLConstants.h>
 
@@ -44,6 +45,14 @@ using namespace opensaml;
 using namespace xmltooling;
 using namespace std;
 
+ArtifactResolver::ArtifactResolver()
+{
+}
+
+ArtifactResolver::~ArtifactResolver()
+{
+}
+
 saml1p::Response* ArtifactResolver::resolve(
     const vector<SAMLArtifact*>& artifacts,
     const IDPSSODescriptor& idpDescriptor,
@@ -56,7 +65,7 @@ saml1p::Response* ArtifactResolver::resolve(
 
     bool foundEndpoint = false;
     auto_ptr_XMLCh binding(samlconstants::SAML1_BINDING_SOAP);
-    saml1p::Response* response=NULL;
+    saml1p::Response* response=nullptr;
     const vector<ArtifactResolutionService*>& endpoints=idpDescriptor.getArtifactResolutionServices();
     for (vector<ArtifactResolutionService*>::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) {
         try {
@@ -87,7 +96,7 @@ saml1p::Response* ArtifactResolver::resolve(
         throw MetadataException("No compatible endpoint found in issuer's metadata.");
     else if (!response)
         throw BindingException("Unable to resolve artifact(s) into a SAML response.");
-    const xmltooling::QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : NULL;
+    const xmltooling::QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : nullptr;
     if (!code || *code != saml1p::StatusCode::SUCCESS) {
         delete response;
         throw BindingException("Identity provider returned a SAML error in response to artifact(s).");
@@ -110,7 +119,7 @@ ArtifactResponse* ArtifactResolver::resolve(
 
     bool foundEndpoint = false;
     auto_ptr_XMLCh binding(samlconstants::SAML20_BINDING_SOAP);
-    ArtifactResponse* response=NULL;
+    ArtifactResponse* response=nullptr;
     const vector<ArtifactResolutionService*>& endpoints=ssoDescriptor.getArtifactResolutionServices();
     for (vector<ArtifactResolutionService*>::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) {
         try {