Strip linefeeds from base64.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 31 Mar 2005 02:01:24 +0000 (02:01 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 31 Mar 2005 02:01:24 +0000 (02:01 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@1449 cb58f699-b61c-0410-a6fe-9272a202ed29

shib-target/shib-target.cpp

index a9763b6..f4aa7f7 100644 (file)
@@ -717,9 +717,11 @@ ShibTarget::doExportAssertions(bool exportAssertion)
             ostringstream os;
             os << *(m_priv->m_pre_response);
             unsigned int outlen;
-            char* resp = (char*)os.str().c_str();
-            XMLByte* serialized = Base64::encode(reinterpret_cast<XMLByte*>(resp), os.str().length(), &outlen);
-            // TODO: strip linefeeds
+            XMLByte* serialized = Base64::encode(reinterpret_cast<XMLByte*>((char*)os.str().c_str()), os.str().length(), &outlen);
+            for (XMLByte* pos=serialized, *pos2=serialized; *pos2; pos2++)
+                if (isgraph(*pos2))
+                    *pos++=*pos2;
+            *pos=0;
             setHeader("Shib-Attributes", reinterpret_cast<char*>(serialized));
             XMLString::release(&serialized);
         }