From: Scott Cantor Date: Sun, 13 Aug 2006 22:57:17 +0000 (+0000) Subject: Stop blowing away native signature from setters, need xmlsec fix to complete. X-Git-Tag: 1.0-alpha1~199 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=commitdiff_plain;h=a33c094a172cb277eead2a6f00eee653394b078a Stop blowing away native signature from setters, need xmlsec fix to complete. --- diff --git a/xmltooling/signature/impl/XMLSecSignatureImpl.cpp b/xmltooling/signature/impl/XMLSecSignatureImpl.cpp index 2082939..dfda1a4 100644 --- a/xmltooling/signature/impl/XMLSecSignatureImpl.cpp +++ b/xmltooling/signature/impl/XMLSecSignatureImpl.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -83,8 +84,6 @@ namespace xmlsignature { void setSigningKey(XSECCryptoKey* signingKey) { delete m_key; m_key=signingKey; - if (m_key) - releaseThisandParentDOM(); } void setKeyInfo(KeyInfo* keyInfo) { prepareForAssignment(m_keyInfo, keyInfo); @@ -93,7 +92,6 @@ namespace xmlsignature { void setContentReference(ContentReference* reference) { delete m_reference; m_reference=reference; - releaseThisandParentDOM(); } void sign(); @@ -179,6 +177,10 @@ void XMLSecSignatureImpl::sign() try { log.debug("creating signature reference(s)"); + // TODO: Need XML-Sec fixed to clear references. + //DSIGReferenceList* refs = m_signature->getReferenceList(); + //while (refs && refs->getSize()) + // delete refs->removeReference(0); m_reference->createReferences(m_signature); log.debug("computing signature"); diff --git a/xmltoolingtest/SignatureTest.h b/xmltoolingtest/SignatureTest.h index c50b86f..67e4ca4 100644 --- a/xmltoolingtest/SignatureTest.h +++ b/xmltoolingtest/SignatureTest.h @@ -135,11 +135,10 @@ public: for_each(m_resolver->getCertificates().begin(),m_resolver->getCertificates().end(),bind1st(_addcert(),x509Data)); sig->setKeyInfo(keyInfo); - // Signing context for the whole document. - vector sigs(1,sig); DOMElement* rootElement = NULL; try { - rootElement=sxObject->marshall((DOMDocument*)NULL,&sigs); + rootElement=sxObject->marshall((DOMDocument*)NULL); + sig->sign(); } catch (XMLToolingException& e) { TS_TRACE(e.what());