Change license header, remove stale pkg files.
[shibboleth/cpp-opensaml.git] / saml / profile / impl / AudienceRestrictionRule.cpp
index b579931..5201a38 100644 (file)
@@ -1,17 +1,21 @@
-/*
- *  Copyright 2009 Internet2
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
  *
- * 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
+ * UCAID licenses this file to you 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
+ * 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.
+ * 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.
  */
 
 /**
@@ -22,6 +26,7 @@
 
 #include "internal.h"
 #include "exceptions.h"
+#include "binding/SecurityPolicy.h"
 #include "binding/SecurityPolicyRule.h"
 #include "saml1/core/Assertions.h"
 #include "saml2/core/Assertions.h"
@@ -58,7 +63,7 @@ namespace opensaml {
 
 AudienceRestrictionRule::AudienceRestrictionRule(const DOMElement* e)
 {
-    e = e ? XMLHelper::getFirstChildElement(e, saml2::Audience::LOCAL_NAME) : NULL;
+    e = e ? XMLHelper::getFirstChildElement(e, saml2::Audience::LOCAL_NAME) : nullptr;
     while (e) {
         if (e->hasChildNodes())
             m_audiences.push_back(e->getFirstChild()->getNodeValue());
@@ -72,8 +77,8 @@ bool AudienceRestrictionRule::evaluate(const XMLObject& message, const GenericRe
     if (ac2) {
         const vector<saml2::Audience*>& auds2 = ac2->getAudiences();
         for (vector<saml2::Audience*>::const_iterator a1 = auds2.begin(); a1!=auds2.end(); ++a1) {
-            for (vector<const XMLCh*>::const_iterator a2 = policy.getAudiences().begin(); a2!=policy.getAudiences().end(); ++a2) {
-                if (XMLString::equals((*a1)->getAudienceURI(), *a2))
+            for (vector<xstring>::const_iterator a2 = policy.getAudiences().begin(); a2!=policy.getAudiences().end(); ++a2) {
+                if (XMLString::equals((*a1)->getAudienceURI(), a2->c_str()))
                     return true;
             }
             for (vector<const XMLCh*>::const_iterator a2 = m_audiences.begin(); a2!=m_audiences.end(); ++a2) {
@@ -94,8 +99,8 @@ bool AudienceRestrictionRule::evaluate(const XMLObject& message, const GenericRe
     if (ac1) {
         const vector<saml1::Audience*>& auds1 = ac1->getAudiences();
         for (vector<saml1::Audience*>::const_iterator a1 = auds1.begin(); a1!=auds1.end(); ++a1) {
-            for (vector<const XMLCh*>::const_iterator a2 = policy.getAudiences().begin(); a2!=policy.getAudiences().end(); ++a2) {
-                if (XMLString::equals((*a1)->getAudienceURI(), *a2))
+            for (vector<xstring>::const_iterator a2 = policy.getAudiences().begin(); a2!=policy.getAudiences().end(); ++a2) {
+                if (XMLString::equals((*a1)->getAudienceURI(), a2->c_str()))
                     return true;
             }
             for (vector<const XMLCh*>::const_iterator a2 = m_audiences.begin(); a2!=m_audiences.end(); ++a2) {