X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fbinding%2Fimpl%2FSecurityPolicy.cpp;h=ba31f94f6fb8139c1cb21350f2006b2e05035946;hb=f1208cd2f514700244816377443c4951dc22c848;hp=2d404254b82f2045b101de15147e1714e518d5c2;hpb=d8a4f024b89272eae00618fc39e6127b6c191edd;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/binding/impl/SecurityPolicy.cpp b/saml/binding/impl/SecurityPolicy.cpp index 2d40425..ba31f94 100644 --- a/saml/binding/impl/SecurityPolicy.cpp +++ b/saml/binding/impl/SecurityPolicy.cpp @@ -1,17 +1,21 @@ -/* - * Copyright 2001-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. */ /** @@ -26,6 +30,8 @@ #include "binding/SecurityPolicyRule.h" #include "saml2/core/Assertions.h" +#include + using namespace opensaml::saml2md; using namespace opensaml::saml2; using namespace opensaml; @@ -81,14 +87,14 @@ SecurityPolicy::SecurityPolicy( const xmltooling::QName* role, const xmltooling::TrustEngine* trustEngine, bool validate - ) : m_metadataCriteria(NULL), + ) : m_metadataCriteria(nullptr), m_issueInstant(0), - m_issuer(NULL), - m_issuerRole(NULL), + m_issuer(nullptr), + m_issuerRole(nullptr), m_authenticated(false), - m_matchingPolicy(NULL), + m_matchingPolicy(nullptr), m_metadata(metadataProvider), - m_role(NULL), + m_role(nullptr), m_trust(trustEngine), m_validate(validate), m_entityOnly(true), @@ -151,7 +157,7 @@ vector& SecurityPolicy::getAudiences() time_t SecurityPolicy::getTime() const { if (m_ts == 0) - return m_ts = time(NULL); + return m_ts = time(nullptr); return m_ts; } @@ -180,7 +186,7 @@ void SecurityPolicy::setMetadataProviderCriteria(MetadataProvider::Criteria* cri void SecurityPolicy::setRole(const xmltooling::QName* role) { delete m_role; - m_role = role ? new xmltooling::QName(*role) : NULL; + m_role = role ? new xmltooling::QName(*role) : nullptr; } void SecurityPolicy::setTrustEngine(const TrustEngine* trust) @@ -227,8 +233,8 @@ void SecurityPolicy::_reset(bool messageOnly) m_issueInstant=0; if (!messageOnly) { delete m_issuer; - m_issuer=NULL; - m_issuerRole=NULL; + m_issuer=nullptr; + m_issuerRole=nullptr; m_authenticated=false; } } @@ -278,7 +284,7 @@ void SecurityPolicy::setIssuer(const Issuer* issuer) if (!m_issuer) { if (m_entityOnly && issuer->getFormat() && !XMLString::equals(issuer->getFormat(), NameIDType::ENTITY)) throw SecurityPolicyException("A non-entity Issuer was supplied, violating policy."); - m_issuerRole = NULL; + m_issuerRole = nullptr; m_issuer=issuer->cloneIssuer(); } } @@ -289,7 +295,7 @@ void SecurityPolicy::setIssuer(const XMLCh* issuer) throw SecurityPolicyException("An Issuer was supplied that conflicts with previous results."); if (!m_issuer && issuer && *issuer) { - m_issuerRole = NULL; + m_issuerRole = nullptr; m_issuer = IssuerBuilder::buildIssuer(); m_issuer->setName(issuer); } @@ -317,7 +323,7 @@ SecurityPolicy::IssuerMatchingPolicy::~IssuerMatchingPolicy() bool SecurityPolicy::IssuerMatchingPolicy::issuerMatches(const Issuer* issuer1, const Issuer* issuer2) const { - // NULL matches anything for the purposes of this interface. + // nullptr matches anything for the purposes of this interface. if (!issuer1 || !issuer2) return true; @@ -346,7 +352,7 @@ bool SecurityPolicy::IssuerMatchingPolicy::issuerMatches(const Issuer* issuer1, bool SecurityPolicy::IssuerMatchingPolicy::issuerMatches(const Issuer* issuer1, const XMLCh* issuer2) const { - // NULL matches anything for the purposes of this interface. + // nullptr matches anything for the purposes of this interface. if (!issuer1 || !issuer2 || !*issuer2) return true;