SSPCPP-616 - clean up concatenated string literals
[shibboleth/cpp-sp.git] / shibsp / handler / impl / SAML2SessionInitiator.cpp
index 2e10df3..d4265c3 100644 (file)
@@ -126,6 +126,21 @@ namespace shibsp {
     #pragma warning( pop )
 #endif
 
+    class SHIBSP_DLLLOCAL SessionInitiatorNodeFilter : public DOMNodeFilter
+    {
+    public:
+#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE
+        short
+#else
+        FilterAction
+#endif
+        acceptNode(const DOMNode* node) const {
+            return FILTER_REJECT;
+        }
+    };
+
+    static SHIBSP_DLLLOCAL SessionInitiatorNodeFilter g_SINFilter;
+
     SessionInitiator* SHIBSP_DLLLOCAL SAML2SessionInitiatorFactory(const pair<const DOMElement*,const char*>& p)
     {
         return new SAML2SessionInitiator(p.first, p.second);
@@ -134,7 +149,7 @@ namespace shibsp {
 };
 
 SAML2SessionInitiator::SAML2SessionInitiator(const DOMElement* e, const char* appId)
-    : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".SessionInitiator.SAML2"), nullptr, &m_remapper), m_appId(appId),
+    : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT ".SessionInitiator.SAML2"), &g_SINFilter, &m_remapper), m_appId(appId),
         m_paosNS(samlconstants::PAOS_NS), m_ecpNS(samlconstants::SAML20ECP_NS), m_paosBinding(samlconstants::SAML20_BINDING_PAOS)
 #ifdef SHIBSP_LITE
         ,m_ecp(false)
@@ -199,6 +214,7 @@ void SAML2SessionInitiator::init(const char* location)
         pair<bool,const char*> outgoing = getString("outgoingBindings");
         if (outgoing.first) {
             dupBindings = outgoing.second;
+            trim(dupBindings);
         }
         else {
             // No override, so we'll install a default binding precedence.
@@ -649,6 +665,7 @@ pair<bool,long> SAML2SessionInitiator::doRequest(
         if (authnContextClassRef) {
             reqContext->getAuthnContextDeclRefs().clear();
             string dup(authnContextClassRef);
+            trim(dup);
             vector<string> contexts;
             split(contexts, dup, is_space(), algorithm::token_compress_on);
             for (vector<string>::const_iterator ac = contexts.begin(); ac != contexts.end(); ++ac) {