From 6698e5b9bd544a1a9a0fef5b7b7d5f81028f9d2f Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Thu, 3 Apr 2008 19:40:27 +0000 Subject: [PATCH] Guard against empty RequestedAuthnContext generation. --- shibsp/handler/impl/SAML2SessionInitiator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp index 0454e4d..f4dac41 100644 --- a/shibsp/handler/impl/SAML2SessionInitiator.cpp +++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp @@ -608,8 +608,11 @@ pair SAML2SessionInitiator::doRequest( cref->setReference(wideclass.get()); reqContext->getAuthnContextClassRefs().push_back(cref); } - if (authnContextComparison && - (!reqContext->getAuthnContextClassRefs().empty() || !reqContext->getAuthnContextDeclRefs().empty())) { + + if (reqContext->getAuthnContextClassRefs().empty() && reqContext->getAuthnContextDeclRefs().empty()) { + req->setRequestedAuthnContext(NULL); + } + else if (authnContextComparison) { auto_ptr_XMLCh widecomp(authnContextComparison); reqContext->setComparison(widecomp.get()); } -- 2.1.4