https://issues.shibboleth.net/jira/browse/CPPXT-90
authorScott Cantor <cantor.2@osu.edu>
Wed, 12 Sep 2012 18:52:28 +0000 (18:52 +0000)
committerScott Cantor <cantor.2@osu.edu>
Wed, 12 Sep 2012 18:52:28 +0000 (18:52 +0000)
xmltooling/security/impl/BasicX509Credential.cpp
xmltooling/signature/impl/KeyInfoImpl.cpp

index 93c99b2..a091d5b 100644 (file)
@@ -203,7 +203,7 @@ void BasicX509Credential::initKeyInfo(unsigned int types)
         xsecsize_t x;
         XMLByte* decoded = Base64::decode(reinterpret_cast<const XMLByte*>(buf.rawCharBuffer()), &x);
         if (decoded) {
-            string xdig = SecurityHelper::doHash("SHA1", reinterpret_cast<char*>(decoded), x);
+            string xdig = SecurityHelper::doHash("SHA1", reinterpret_cast<char*>(decoded), x, false);
 #ifdef XMLTOOLING_XERCESC_HAS_XMLBYTE_RELEASE
             XMLString::release(&decoded);
 #else
@@ -219,6 +219,7 @@ void BasicX509Credential::initKeyInfo(unsigned int types)
 #endif
                 X509Digest* x509dig = X509DigestBuilder::buildX509Digest();
                 x509dig->setValue(widenit.get());
+                x509dig->setAlgorithm(DSIGConstants::s_unicodeStrURISHA1);
                 m_compactKeyInfo->getX509Datas().front()->getX509Digests().push_back(x509dig);
             }
         }
index a260727..910267c 100644 (file)
@@ -557,7 +557,7 @@ namespace xmlsignature {
     };
 
     class XMLTOOL_DLLLOCAL X509DigestImpl : public virtual X509Digest,
-        public AbstractComplexElement,
+        public AbstractSimpleElement,
         public AbstractDOMCachingXMLObject,
         public AbstractXMLObjectMarshaller,
         public AbstractXMLObjectUnmarshaller
@@ -572,7 +572,7 @@ namespace xmlsignature {
         }
 
         X509DigestImpl(const X509DigestImpl& src)
-                : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src), m_Algorithm(nullptr) {
+                : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src), m_Algorithm(nullptr) {
             IMPL_CLONE_ATTRIB(Algorithm);
         }