Roll back previous change, not going to work.
[shibboleth/cpp-opensaml.git] / saml / saml1 / binding / impl / SAML1ArtifactDecoder.cpp
index 4c56f2e..ad6e2d9 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 "exceptions.h"
 #include "binding/SAMLArtifact.h"
+#include "binding/SecurityPolicy.h"
 #include "saml1/binding/SAML1MessageDecoder.h"
 #include "saml1/core/Protocols.h"
 #include "saml2/metadata/Metadata.h"
 #include "saml2/metadata/MetadataProvider.h"
 
 #include <xmltooling/logging.h>
+#include <xmltooling/XMLToolingConfig.h>
 #include <xmltooling/io/HTTPRequest.h>
 #include <xmltooling/util/NDC.h>
 #include <xmltooling/util/ReplayCache.h>
@@ -77,8 +79,6 @@ XMLObject* SAML1ArtifactDecoder::decode(
     const HTTPRequest* httpRequest=dynamic_cast<const HTTPRequest*>(&genericRequest);
     if (!httpRequest)
         throw BindingException("Unable to cast request object to HTTPRequest type.");
-    if (strcmp(httpRequest->getMethod(),"GET"))
-        throw BindingException("Invalid HTTP method ($1).", params(1, httpRequest->getMethod()));
     vector<const char*> SAMLart;
     const char* TARGET = httpRequest->getParameter("TARGET");
     if (httpRequest->getParameters("SAMLart", SAMLart)==0 || !TARGET)
@@ -97,7 +97,7 @@ XMLObject* SAML1ArtifactDecoder::decode(
             // Check replay.
             ReplayCache* replayCache = XMLToolingConfig::getConfig().getReplayCache();
             if (replayCache) {
-                if (!replayCache->check("SAML1Artifact", *raw, time(NULL) + (2*XMLToolingConfig::getConfig().clock_skew_secs))) {
+                if (!replayCache->check("SAML1Artifact", *raw, time(nullptr) + (2*XMLToolingConfig::getConfig().clock_skew_secs))) {
                     log.error("replay detected of artifact (%s)", *raw);
                     throw BindingException("Rejecting replayed artifact ($1).", params(1,*raw));
                 }