[cpp-sp] branch master updated: SSPCPP-613 - make initial ; in cookieProps optional

Scott Cantor cantor.2 at osu.edu
Thu Feb 8 13:25:33 EST 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=f9074c8150d31fa2df9c3fa03eb842bdf2496795

The following commit(s) were added to refs/heads/master by this push:
       new  f9074c8   SSPCPP-613 - make initial ; in cookieProps optional
f9074c8 is described below

commit f9074c8150d31fa2df9c3fa03eb842bdf2496795
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Feb 8 13:25:01 2018 -0500

    SSPCPP-613 - make initial ; in cookieProps optional
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-613
---
 shibsp/impl/XMLServiceProvider.cpp | 61 +++++++++++++++++++++++++-------------
 1 file changed, 41 insertions(+), 20 deletions(-)

diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp
index 1108ea7..5a78b60 100644
--- a/shibsp/impl/XMLServiceProvider.cpp
+++ b/shibsp/impl/XMLServiceProvider.cpp
@@ -1491,30 +1491,51 @@ void XMLApplication::doAttributePlugins(DOMElement* e, Category& log)
 }
 #endif
 
+
 DOMNodeFilter::FilterAction XMLApplication::acceptNode(const DOMNode* node) const
 {
     const XMLCh* name=node->getLocalName();
-    if (XMLString::equals(name,ApplicationOverride) ||
-        XMLString::equals(name,_Audience) ||
-        XMLString::equals(name,Notify) ||
-        XMLString::equals(name,_Handler) ||
-        XMLString::equals(name,_AssertionConsumerService) ||
-        XMLString::equals(name,_ArtifactResolutionService) ||
-        XMLString::equals(name,Logout) ||
-        XMLString::equals(name,_LogoutInitiator) ||
-        XMLString::equals(name,_ManageNameIDService) ||
-        XMLString::equals(name,NameIDMgmt) ||
-        XMLString::equals(name,_SessionInitiator) ||
-        XMLString::equals(name,_SingleLogoutService) ||
-        XMLString::equals(name,SSO) ||
-        XMLString::equals(name,RelyingParty) ||
-        XMLString::equals(name,_MetadataProvider) ||
-        XMLString::equals(name,_TrustEngine) ||
-        XMLString::equals(name,_CredentialResolver) ||
-        XMLString::equals(name,_AttributeFilter) ||
-        XMLString::equals(name,_AttributeExtractor) ||
-        XMLString::equals(name,_AttributeResolver))
+    if (XMLString::equals(name, ApplicationOverride) ||
+        XMLString::equals(name, _Audience) ||
+        XMLString::equals(name, Notify) ||
+        XMLString::equals(name, _Handler) ||
+        XMLString::equals(name, _AssertionConsumerService) ||
+        XMLString::equals(name, _ArtifactResolutionService) ||
+        XMLString::equals(name, Logout) ||
+        XMLString::equals(name, _LogoutInitiator) ||
+        XMLString::equals(name, _ManageNameIDService) ||
+        XMLString::equals(name, NameIDMgmt) ||
+        XMLString::equals(name, _SessionInitiator) ||
+        XMLString::equals(name, _SingleLogoutService) ||
+        XMLString::equals(name, SSO) ||
+        XMLString::equals(name, RelyingParty) ||
+        XMLString::equals(name, _MetadataProvider) ||
+        XMLString::equals(name, _TrustEngine) ||
+        XMLString::equals(name, _CredentialResolver) ||
+        XMLString::equals(name, _AttributeFilter) ||
+        XMLString::equals(name, _AttributeExtractor) ||
+        XMLString::equals(name, _AttributeResolver)) {
         return FILTER_REJECT;
+    }
+
+    const XMLCh _cookieProps[] = UNICODE_LITERAL_11(c,o,o,k,i,e,P,r,o,p,s);
+    const XMLCh _http[] = UNICODE_LITERAL_4(h,t,t,p);
+    const XMLCh _https[] = UNICODE_LITERAL_5(h,t,t,p,s);
+    const XMLCh _Sessions[] = UNICODE_LITERAL_8(S,e,s,s,i,o,n,s);
+
+    if (XMLString::equals(name, _Sessions)) {
+        // This is a hack, but it's a fairly clean way to mutate a setting.
+        DOMNode* cookieProps = node->getAttributes()->getNamedItemNS(nullptr, _cookieProps);
+        if (cookieProps) {
+            const XMLCh* val = cookieProps->getNodeValue();
+            if (!val || (*val != chSemiColon && !XMLString::equals(val, _http) && !XMLString::equals(val, _https))) {
+                xstring newval(1, chSemiColon);
+                newval += chSpace;
+                newval += val;
+                cookieProps->setNodeValue(newval.c_str());
+            }
+        }
+    }
 
     return FILTER_ACCEPT;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list