Handle relayStateLimit="none", unrecognized values.
authorscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Sun, 20 Feb 2011 20:49:51 +0000 (20:49 +0000)
committerscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Sun, 20 Feb 2011 20:49:51 +0000 (20:49 +0000)
git-svn-id: https://svn.shibboleth.net/cpp-sp/branches/REL_2@3404 cb58f699-b61c-0410-a6fe-9272a202ed29

shibsp/handler/impl/AbstractHandler.cpp

index 967351b..4944e0c 100644 (file)
@@ -118,7 +118,7 @@ namespace shibsp {
         const PropertySet* sessionProps = application.getPropertySet("Sessions");
         if (sessionProps) {
             pair<bool,const char*> relayStateLimit = sessionProps->getString("relayStateLimit");
-            if (relayStateLimit.first) {
+            if (relayStateLimit.first && strcmp(relayStateLimit.second, "none")) {
                 vector<string> whitelist;
                 if (!strcmp(relayStateLimit.second, "exact")) {
                     // Scheme and hostname have to match.
@@ -159,6 +159,10 @@ namespace shibsp {
                         }
                     }
                 }
+                else {
+                    log.warn("unrecognized relayStateLimit policy (%s), blocked redirect to (%s)", relayStateLimit.second, relayState);
+                    throw opensaml::SecurityPolicyException("Unrecognized relayStateLimit setting.");
+                }
 
                 for (vector<string>::const_iterator w = whitelist.begin(); w != whitelist.end(); ++w) {
                     if (XMLString::startsWithI(relayState, w->c_str())) {