X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1POSTDecoder.cpp;fp=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1POSTDecoder.cpp;h=bc00f7f6efaee09910c3b6c3fd5bbd0445f783d0;hb=fef3b8aa4629acf08791580fd7d09b35218061f6;hp=b9651abc7d26731f90da915f4e05f15aaa71d38b;hpb=6f852a1ba3ba11eaeb83148b5998afcfea7ce342;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp index b9651ab..bc00f7f 100644 --- a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp @@ -116,12 +116,13 @@ XMLObject* SAML1POSTDecoder::decode( // Check recipient URL. auto_ptr_char recipient(response->getRecipient()); const char* recipient2 = httpRequest->getRequestURL(); + const char* delim = strchr(recipient2, '?'); if (!recipient.get() || !*(recipient.get())) { log.error("response missing Recipient attribute"); throw BindingException("SAML response did not contain Recipient attribute identifying intended destination."); } - else if (!recipient2 || !*recipient2 || strcmp(recipient.get(),recipient2)) { - log.error("POST targeted at (%s), but delivered to (%s)", recipient.get(), recipient2 ? recipient2 : "none"); + else if ((delim && strncmp(recipient.get(), recipient2, delim - recipient2)) || (!delim && strcmp(recipient.get(),recipient2))) { + log.error("POST targeted at (%s), but delivered to (%s)", recipient.get(), recipient2); throw BindingException("SAML message delivered with POST to incorrect server URL."); }