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=0ce1779bd5a810f437acdebe499b2254202e5321;hb=2e9c2aecfff05cbe8802d46ea419f7101d263c87;hp=0e60ffd9a471030ef3122aefff868612240e8a97;hpb=0ac2fef3fe7270a1b2f4db04f3ccfe9e005cb1bf;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp index 0e60ffd..0ce1779 100644 --- a/saml/saml1/binding/impl/SAML1POSTDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1POSTDecoder.cpp @@ -28,6 +28,8 @@ #include "saml2/metadata/Metadata.h" #include "saml2/metadata/MetadataProvider.h" +#include +#include #include #include #include @@ -87,18 +89,18 @@ XMLObject* SAML1POSTDecoder::decode( throw BindingException("Request missing SAMLResponse or TARGET form parameters."); relayState = TARGET; - // Decode the base64 into SAML. + // Decode the base64 into XML. unsigned int x; XMLByte* decoded=Base64::decode(reinterpret_cast(samlResponse),&x); if (!decoded) throw BindingException("Unable to decode base64 in POST profile response."); - log.debug("decoded SAML response:\n%s", decoded); - istringstream is(reinterpret_cast(decoded)); - XMLString::release(&decoded); - + log.debugStream() << "decoded SAML response:" << logging::eol << decoded << logging::eol; + // Parse and bind the document into an XMLObject. + MemBufInputSource src(decoded, x, "SAMLResponse", true); + Wrapper4InputSource dsrc(&src, false); DOMDocument* doc = (policy.getValidating() ? XMLToolingConfig::getConfig().getValidatingParser() - : XMLToolingConfig::getConfig().getParser()).parse(is); + : XMLToolingConfig::getConfig().getParser()).parse(dsrc); XercesJanitor janitor(doc); auto_ptr xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true)); janitor.release();