X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fopensaml2.git;a=blobdiff_plain;f=saml%2Fsaml2%2Fbinding%2Fimpl%2FSAML2POSTDecoder.cpp;h=f85e0f32cd22ab38498365e7e891cda94c2ffb35;hp=db218a071479a37e6c2a176f650cfe79132ff4b7;hb=6a695b7ac9c934a1d3a6c06a04c677f589d631d9;hpb=ea4876e0e13b5ad6147a4d7a5a8e9bd3dbbf5bbf diff --git a/saml/saml2/binding/impl/SAML2POSTDecoder.cpp b/saml/saml2/binding/impl/SAML2POSTDecoder.cpp index db218a0..f85e0f3 100644 --- a/saml/saml2/binding/impl/SAML2POSTDecoder.cpp +++ b/saml/saml2/binding/impl/SAML2POSTDecoder.cpp @@ -129,12 +129,13 @@ XMLObject* SAML2POSTDecoder::decode( // Check destination URL. auto_ptr_char dest(request ? request->getDestination() : response->getDestination()); const char* dest2 = httpRequest->getRequestURL(); + const char* delim = strchr(dest2, '?'); if ((root->getSignature() || httpRequest->getParameter("Signature")) && (!dest.get() || !*(dest.get()))) { log.error("signed SAML message missing Destination attribute"); throw BindingException("Signed SAML message missing Destination attribute identifying intended destination."); } - else if (dest.get() && (!dest2 || !*dest2 || strcmp(dest.get(),dest2))) { - log.error("POST targeted at (%s), but delivered to (%s)", dest.get(), dest2 ? dest2 : "none"); + else if ((delim && strncmp(dest.get(), dest2, delim - dest2)) || (!delim && strcmp(dest.get(),dest2))) { + log.error("POST targeted at (%s), but delivered to (%s)", dest.get(), dest2); throw BindingException("SAML message delivered with POST to incorrect server URL."); }