binding/ArtifactMap.h \
binding/MessageDecoder.h \
binding/MessageEncoder.h \
- binding/ReplayCache.h \
binding/SAMLArtifact.h \
binding/URLEncoder.h
binding/impl/ArtifactMap.cpp \
binding/impl/MessageDecoder.cpp \
binding/impl/MessageEncoder.cpp \
- binding/impl/ReplayCache.cpp \
binding/impl/SAMLArtifact.cpp \
binding/impl/URLEncoder.cpp \
saml1/core/impl/AssertionsImpl.cpp \
#include "binding/ArtifactMap.h"
#include "binding/MessageDecoder.h"
#include "binding/MessageEncoder.h"
-#include "binding/ReplayCache.h"
#include "binding/SAMLArtifact.h"
#include "binding/URLEncoder.h"
#include "saml1/core/Assertions.h"
m_urlEncoder = urlEncoder;
}
-void SAMLConfig::setReplayCache(ReplayCache* replayCache)
-{
- delete m_replayCache;
- m_replayCache = replayCache;
-}
-
bool SAMLInternalConfig::init(bool initXMLTooling)
{
#ifdef _DEBUG
m_artifactMap = NULL;
delete m_urlEncoder;
m_urlEncoder = NULL;
- delete m_replayCache;
- m_replayCache = NULL;
if (termXMLTooling) {
XMLToolingConfig::getConfig().term();
class SAML_API ArtifactMap;\r
class SAML_API MessageEncoder;\r
class SAML_API MessageDecoder;\r
- class SAML_API ReplayCache;\r
class SAML_API SAMLArtifact;\r
class SAML_API TrustEngine;\r
class SAML_API URLEncoder;\r
}\r
\r
/**\r
- * Sets the global ReplayCache instance.\r
- * This method must be externally synchronized with any code that uses the object.\r
- * Any previously set object is destroyed.\r
- * \r
- * @param replayCache new ReplayCache instance to store\r
- */\r
- void setReplayCache(ReplayCache* replayCache);\r
-\r
- /**\r
- * Returns the global ReplayCache instance.\r
- * \r
- * @return global ReplayCache or NULL\r
- */\r
- ReplayCache* getReplayCache() const {\r
- return m_replayCache;\r
- }\r
- \r
- /**\r
* Generate random information using the underlying security library\r
* \r
* @param buf buffer for the information\r
xmltooling::PluginManager<saml2md::MetadataFilter,const DOMElement*> MetadataFilterManager;\r
\r
protected:\r
- SAMLConfig() : m_artifactMap(NULL), m_urlEncoder(NULL), m_replayCache(NULL) {}\r
+ SAMLConfig() : m_artifactMap(NULL), m_urlEncoder(NULL) {}\r
\r
/** Global ArtifactMap instance for use by artifact-related functions. */\r
ArtifactMap* m_artifactMap;\r
\r
/** Global URLEncoder instance for use by URL-related functions. */\r
URLEncoder* m_urlEncoder;\r
- \r
- /** Global ReplayCache instance. */\r
- ReplayCache* m_replayCache;\r
};\r
\r
#if defined (_MSC_VER)\r
+++ /dev/null
-/*\r
- * Copyright 2001-2006 Internet2\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-/**\r
- * @file saml/binding/ReplayCache.h\r
- * \r
- * Helper class on top of StorageService for detecting message replay.\r
- */\r
-\r
-#ifndef __saml_replay_h__\r
-#define __saml_replay_h__\r
-\r
-#include <saml/base.h>\r
-#include <xmltooling/util/StorageService.h>\r
-\r
-namespace opensaml {\r
-\r
- /**\r
- * Helper class on top of StorageService for detecting message replay.\r
- */\r
- class SAML_API ReplayCache\r
- {\r
- MAKE_NONCOPYABLE(ReplayCache);\r
- public:\r
- \r
- /**\r
- * Creates a replay cache on top of a particular StorageService.\r
- * \r
- * @param storage pointer to a StorageService, or NULL to keep cache in memory\r
- */\r
- ReplayCache(xmltooling::StorageService* storage=NULL);\r
-\r
- virtual ~ReplayCache();\r
- \r
- /**\r
- * Returns true iff the check value is not found in the cache, and stores it.\r
- * \r
- * @param context a context label to subdivide the cache\r
- * @param s value to check\r
- * @param expires time for disposal of value from cache\r
- */\r
- virtual bool check(const char* context, const char* s, time_t expires);\r
- \r
- bool check(const char* context, const XMLCh* str, time_t expires) {\r
- xmltooling::auto_ptr_char temp(str);\r
- return check(context, temp.get(), expires);\r
- }\r
- \r
- private:\r
- xmltooling::StorageService* m_storage;\r
- };\r
-};\r
-\r
-#endif /* __saml_replay_h__ */\r
+++ /dev/null
-/*
- * Copyright 2001-2006 Internet2
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * ReplayCache.cpp
- *
- * Helper class on top of StorageService for detecting message replay.
- */
-
-#include "internal.h"
-#include "binding/ReplayCache.h"
-
-using namespace opensaml;
-using namespace xmltooling;
-using namespace std;
-
-ReplayCache::ReplayCache(StorageService* storage) : m_storage(storage)
-{
- if (!m_storage)
- m_storage = XMLToolingConfig::getConfig().StorageServiceManager.newPlugin(MEMORY_STORAGE_SERVICE, NULL);
-}
-
-ReplayCache::~ReplayCache()
-{
- delete m_storage;
-}
-
-bool ReplayCache::check(const char* context, const char* s, time_t expires)
-{
- // In storage already?
- if (m_storage->readString(context, s))
- return false;
- m_storage->createText(context, s, "x", expires);
- return true;
-}
>\r
</File>\r
<File\r
- RelativePath=".\binding\impl\ReplayCache.cpp"\r
- >\r
- </File>\r
- <File\r
RelativePath=".\binding\impl\SAMLArtifact.cpp"\r
>\r
</File>\r
>\r
</File>\r
<File\r
- RelativePath=".\binding\ReplayCache.h"\r
- >\r
- </File>\r
- <File\r
RelativePath=".\binding\SAMLArtifact.h"\r
>\r
</File>\r
#include "internal.h"
#include "exceptions.h"
#include "saml/binding/SAMLArtifact.h"
-#include "saml/binding/ReplayCache.h"
#include "saml1/binding/SAML1ArtifactDecoder.h"
#include "saml2/metadata/Metadata.h"
#include "saml2/metadata/MetadataProvider.h"
#include <log4cpp/Category.hh>
#include <xmltooling/util/NDC.h>
+#include <xmltooling/util/ReplayCache.h>
using namespace opensaml::saml2md;
using namespace opensaml::saml1p;
log.debug("processing encoded artifact (%s)", *raw);
// Check replay.
- ReplayCache* replayCache = SAMLConfig::getConfig().getReplayCache();
+ ReplayCache* replayCache = XMLToolingConfig::getConfig().getReplayCache();
if (replayCache) {
if (!replayCache->check("SAML1Artifact", *raw, time(NULL) + (2*XMLToolingConfig::getConfig().clock_skew_secs))) {
log.error("replay detected of artifact (%s)", *raw);
#include "internal.h"
#include "exceptions.h"
-#include "saml/binding/ReplayCache.h"
#include "saml1/binding/SAML1POSTDecoder.h"
#include "saml2/metadata/Metadata.h"
#include "saml2/metadata/MetadataProvider.h"
#include <log4cpp/Category.hh>
#include <xercesc/util/Base64.hpp>
#include <xmltooling/util/NDC.h>
+#include <xmltooling/util/ReplayCache.h>
using namespace opensaml::saml2md;
using namespace opensaml::saml1p;
throw BindingException("Detected expired POST profile response.");
// Check replay.
- ReplayCache* replayCache = SAMLConfig::getConfig().getReplayCache();
+ ReplayCache* replayCache = XMLToolingConfig::getConfig().getReplayCache();
if (replayCache) {
auto_ptr_char id(response->getResponseID());
if (!replayCache->check("SAML1POST", id.get(), response->getIssueInstant()->getEpoch() + (2*XMLToolingConfig::getConfig().clock_skew_secs))) {
#include "internal.h"
#include "exceptions.h"
-#include "saml/binding/ReplayCache.h"
#include "saml2/binding/SAML2POSTDecoder.h"
#include "saml2/core/Protocols.h"
#include "saml2/metadata/Metadata.h"
#include <log4cpp/Category.hh>
#include <xercesc/util/Base64.hpp>
#include <xmltooling/util/NDC.h>
+#include <xmltooling/util/ReplayCache.h>
using namespace opensaml::saml2md;
using namespace opensaml::saml2p;
throw BindingException("Detected expired POST binding message.");
// Check replay.
- ReplayCache* replayCache = SAMLConfig::getConfig().getReplayCache();
+ ReplayCache* replayCache = XMLToolingConfig::getConfig().getReplayCache();
if (replayCache) {
auto_ptr_char id(xmlObject->getXMLID());
if (!replayCache->check("SAML2POST", id.get(), response->getIssueInstant()->getEpoch() + (2*XMLToolingConfig::getConfig().clock_skew_secs))) {
*/\r
\r
#include "internal.h"\r
-#include <saml/SAMLConfig.h>\r
-#include <saml/binding/ArtifactMap.h>\r
-#include <saml/binding/ReplayCache.h>\r
-\r
#include <fstream>\r
#include <cxxtest/GlobalFixture.h>\r
+#include <saml/SAMLConfig.h>\r
+#include <saml/binding/ArtifactMap.h>\r
+#include <xmltooling/util/ReplayCache.h>\r
\r
//#define SAML_LEAKCHECK\r
\r
XMLToolingConfig::getConfig().log_config();\r
if (!SAMLConfig::getConfig().init())\r
return false;\r
- SAMLConfig::getConfig().setReplayCache(new ReplayCache());\r
+ XMLToolingConfig::getConfig().setReplayCache(new ReplayCache());\r
SAMLConfig::getConfig().setArtifactMap(new ArtifactMap());\r
\r
if (getenv("SAMLTEST_DATA"))\r
BasicRuntimeChecks="3"\r
RuntimeLibrary="3"\r
UsePrecompiledHeader="0"\r
+ BrowseInformation="1"\r
WarningLevel="3"\r
Detect64BitPortabilityProblems="true"\r
DebugInformationFormat="4"\r
>\r
<Tool\r
Name="VCCustomBuildTool"\r
- CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)""\r
+ CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)"
"\r
Outputs=""$(InputDir)$(InputName)".cpp"\r
/>\r
</FileConfiguration>\r
>\r
<Tool\r
Name="VCCustomBuildTool"\r
- CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)""\r
+ CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)"
"\r
Outputs=""$(InputDir)$(InputName)".cpp"\r
/>\r
</FileConfiguration>\r
>\r
<Tool\r
Name="VCCustomBuildTool"\r
- CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)""\r
+ CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)"
"\r
Outputs=""$(InputDir)$(InputName)".cpp"\r
/>\r
</FileConfiguration>\r
>\r
<Tool\r
Name="VCCustomBuildTool"\r
- CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)""\r
+ CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)"
"\r
Outputs=""$(InputDir)$(InputName)".cpp"\r
/>\r
</FileConfiguration>\r
>\r
<Tool\r
Name="VCCustomBuildTool"\r
- CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)""\r
+ CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)"
"\r
Outputs=""$(InputDir)$(InputName)".cpp"\r
/>\r
</FileConfiguration>\r
>\r
<Tool\r
Name="VCCustomBuildTool"\r
- CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)""\r
+ CommandLine="\perl\bin\perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputDir)$(InputName)".cpp "$(InputPath)"
"\r
Outputs=""$(InputDir)$(InputName)".cpp"\r
/>\r
</FileConfiguration>\r