X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Fattribute%2FNameIDAttribute.cpp;h=fbdb2c9fe234592f8fdbe0c37c3248c6e087fc08;hb=9ed469ffd448bb33c51b546d0c55548fc6faf0a1;hp=9f15c1ec5a1044ab6d5919039e914747a50a36c4;hpb=0329a3436bc25b712d09ba00fda77ac2d1eeb993;p=shibboleth%2Fcpp-sp.git diff --git a/shibsp/attribute/NameIDAttribute.cpp b/shibsp/attribute/NameIDAttribute.cpp index 9f15c1e..fbdb2c9 100644 --- a/shibsp/attribute/NameIDAttribute.cpp +++ b/shibsp/attribute/NameIDAttribute.cpp @@ -29,6 +29,7 @@ #include "attribute/NameIDAttribute.h" #include "remoting/ListenerService.h" +#include #include #include @@ -139,16 +140,19 @@ const vector& NameIDAttribute::getSerializedValues() const ); if (m_hashAlg.empty()) { m_serialized.push_back(e.what()); + boost::trim(m_serialized.back()); } else { + string trimmed(e.what()); + boost::trim(trimmed); #ifndef SHIBSP_LITE - m_serialized.push_back(SecurityHelper::doHash(m_hashAlg.c_str(), e.what(), strlen(e.what()))); + m_serialized.push_back(SecurityHelper::doHash(m_hashAlg.c_str(), trimmed.c_str(), strlen(e.what()))); #else try { DDF out, in("hash"); DDFJanitor jin(in), jout(out); in.addmember("alg").string(m_hashAlg.c_str()); - in.addmember("data").unsafe_string(e.what()); + in.addmember("data").unsafe_string(trimmed.c_str()); out = SPConfig::getConfig().getServiceProvider()->getListenerService()->send(in); if (out.isstring() && out.string()) m_serialized.push_back(out.string());