From 36936e825a0e6dafbdf0127ab0e66c1eb8eabc3d Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Mon, 16 Aug 2010 20:40:36 +0000 Subject: [PATCH] Skip warning when acsIndex not used. --- adfs/adfs.cpp | 3 ++- shibsp/handler/impl/SAML2SessionInitiator.cpp | 3 ++- shibsp/handler/impl/Shib1SessionInitiator.cpp | 3 ++- shibsp/handler/impl/WAYFSessionInitiator.cpp | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/adfs/adfs.cpp b/adfs/adfs.cpp index cac8e85..156cdb1 100644 --- a/adfs/adfs.cpp +++ b/adfs/adfs.cpp @@ -376,7 +376,8 @@ pair ADFSSessionInitiator::run(SPRequest& request, string& entityID, // Validate the ACS for use with this protocol. if (!ACS || !XMLString::equals(getProtocolFamily(), ACS->getProtocolFamily())) { - request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-ADFS ACS, using default ADFS ACS"); + if (ACS) + request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-ADFS ACS, using default ADFS ACS"); ACS = app.getAssertionConsumerServiceByProtocol(getProtocolFamily()); if (!ACS) throw ConfigurationException("Unable to locate an ADFS-compatible ACS in the configuration."); diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp index 3d903f3..f44dca2 100644 --- a/shibsp/handler/impl/SAML2SessionInitiator.cpp +++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp @@ -324,7 +324,8 @@ pair SAML2SessionInitiator::run(SPRequest& request, string& entityID, // If we picked by index, validate the ACS for use with this protocol. if (!ECP && (!ACS || !XMLString::equals(getProtocolFamily(), ACS->getProtocolFamily()))) { - request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-SAML 2.0 ACS, using default SAML 2.0 ACS"); + if (ACS) + request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-SAML 2.0 ACS, using default SAML 2.0 ACS"); ACS = app.getAssertionConsumerServiceByProtocol(getProtocolFamily()); if (!ACS) throw ConfigurationException("Unable to locate a SAML 2.0 ACS endpoint to use for response."); diff --git a/shibsp/handler/impl/Shib1SessionInitiator.cpp b/shibsp/handler/impl/Shib1SessionInitiator.cpp index 6242c66..d3000ca 100644 --- a/shibsp/handler/impl/Shib1SessionInitiator.cpp +++ b/shibsp/handler/impl/Shib1SessionInitiator.cpp @@ -158,7 +158,8 @@ pair Shib1SessionInitiator::run(SPRequest& request, string& entityID, // If we picked by index, validate the ACS for use with this protocol. if (!ACS || !XMLString::equals(getProtocolFamily(), ACS->getProtocolFamily())) { - request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-SAML 1.x ACS, using default SAML 1.x ACS"); + if (ACS) + request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-SAML 1.x ACS, using default SAML 1.x ACS"); ACS = app.getAssertionConsumerServiceByProtocol(getProtocolFamily()); if (!ACS) throw ConfigurationException("Unable to locate a SAML 1.x ACS endpoint to use for response."); diff --git a/shibsp/handler/impl/WAYFSessionInitiator.cpp b/shibsp/handler/impl/WAYFSessionInitiator.cpp index 2947663..459518b 100644 --- a/shibsp/handler/impl/WAYFSessionInitiator.cpp +++ b/shibsp/handler/impl/WAYFSessionInitiator.cpp @@ -131,7 +131,8 @@ pair WAYFSessionInitiator::run(SPRequest& request, string& entityID, // If we picked by index, validate the ACS for use with this protocol. if (!ACS || !XMLString::equals(samlconstants::SAML11_PROTOCOL_ENUM, ACS->getProtocolFamily())) { - request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-SAML 1.x ACS, using default SAML 1.x ACS"); + if (ACS) + request.log(SPRequest::SPWarn, "invalid acsIndex property, or non-SAML 1.x ACS, using default SAML 1.x ACS"); ACS = app.getAssertionConsumerServiceByProtocol(getProtocolFamily()); if (!ACS) throw ConfigurationException("Unable to locate a SAML 1.x ACS endpoint to use for response."); -- 2.1.4