From 0d980d23b63369f144cf377696204c02babbd16f Mon Sep 17 00:00:00 2001 From: cantor Date: Mon, 17 Dec 2007 21:33:10 +0000 Subject: [PATCH] Fix address checking if none supplied. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2673 cb58f699-b61c-0410-a6fe-9272a202ed29 --- shibsp/handler/impl/AssertionConsumerService.cpp | 3 +++ shibsp/handler/impl/SAML2Consumer.cpp | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shibsp/handler/impl/AssertionConsumerService.cpp b/shibsp/handler/impl/AssertionConsumerService.cpp index 69fd4b9..02c7f97 100644 --- a/shibsp/handler/impl/AssertionConsumerService.cpp +++ b/shibsp/handler/impl/AssertionConsumerService.cpp @@ -179,6 +179,9 @@ pair AssertionConsumerService::processMessage( void AssertionConsumerService::checkAddress(const Application& application, const HTTPRequest& httpRequest, const char* issuedTo) const { + if (!issuedTo || !*issuedTo) + return; + const PropertySet* props=application.getPropertySet("Sessions"); pair checkAddress = props ? props->getBool("checkAddress") : make_pair(false,true); if (!checkAddress.first) diff --git a/shibsp/handler/impl/SAML2Consumer.cpp b/shibsp/handler/impl/SAML2Consumer.cpp index 302fe0d..d8fc3ec 100644 --- a/shibsp/handler/impl/SAML2Consumer.cpp +++ b/shibsp/handler/impl/SAML2Consumer.cpp @@ -172,8 +172,7 @@ void SAML2Consumer::implementProtocol( ssoValidator.validateAssertion(*(*a)); // Address checking. - if (ssoValidator.getAddress()) - checkAddress(application, httpRequest, ssoValidator.getAddress()); + checkAddress(application, httpRequest, ssoValidator.getAddress()); // Track it as a valid token. tokens.push_back(*a); @@ -252,8 +251,7 @@ void SAML2Consumer::implementProtocol( ssoValidator.validateAssertion(*decrypted); // Address checking. - if (ssoValidator.getAddress()) - checkAddress(application, httpRequest, ssoValidator.getAddress()); + checkAddress(application, httpRequest, ssoValidator.getAddress()); // Track it as a valid token. tokens.push_back(decrypted); -- 2.1.4