[Libreoffice-commits] core.git: 3 commits - xmlsecurity/source

2016-11-28 Thread Tor Lillqvist
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   41 
--
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx |   35 
+++-
 2 files changed, 16 insertions(+), 60 deletions(-)

New commits:
commit 0b719cd36d57a628fd1ab79d0371fb46e6c1bf1d
Author: Tor Lillqvist 
Date:   Fri Nov 25 17:31:50 2016 +0200

No reason for these member functions to be virtual

Not sure what the author was thinking, or what the comment '//Native
methods' was supposed to mean.

Change-Id: I9e45de6f24531a99770d98f415fea6a1cfd7d2c2

diff --git 
a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx 
b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 444cf93..47435d7 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -239,7 +239,6 @@ SecurityEnvironment_MSCryptImpl* 
SecurityEnvironment_MSCryptImpl::getImplementat
 return nullptr ;
 }
 
-/* Native methods */
 HCRYPTPROV SecurityEnvironment_MSCryptImpl::getCryptoProvider() throw( 
css::uno::Exception , css::uno::RuntimeException ) {
 return m_hProv ;
 }
@@ -1119,7 +1118,6 @@ OUString 
SecurityEnvironment_MSCryptImpl::getSecurityEnvironmentInformation() th
 return OUString("Microsoft Crypto API");
 }
 
-/* Native methods */
 xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() throw( 
Exception, RuntimeException ) {
 
 unsigned int i ;
diff --git 
a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx 
b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
index 0c66ab3..e439b44 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx
@@ -155,31 +155,29 @@ class SecurityEnvironment_MSCryptImpl : public 
::cppu::WeakImplHelper<
 static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
 static SecurityEnvironment_MSCryptImpl* getImplementation( const 
css::uno::Reference< css::uno::XInterface >& rObj ) ;
 
-//Native methods
-virtual HCRYPTPROV getCryptoProvider() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
-virtual void setCryptoProvider( HCRYPTPROV aProv ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
+HCRYPTPROV getCryptoProvider() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
+void setCryptoProvider( HCRYPTPROV aProv ) throw( css::uno::Exception 
, css::uno::RuntimeException ) ;
 
-virtual LPCTSTR getKeyContainer() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
-virtual void setKeyContainer( LPCTSTR aKeyContainer ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
+LPCTSTR getKeyContainer() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
+void setKeyContainer( LPCTSTR aKeyContainer ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
 
-virtual HCERTSTORE getCryptoSlot() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
-virtual void setCryptoSlot( HCERTSTORE aKeyStore ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
+HCERTSTORE getCryptoSlot() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
+void setCryptoSlot( HCERTSTORE aKeyStore ) throw( css::uno::Exception 
, css::uno::RuntimeException ) ;
 
-virtual HCERTSTORE getCertDb() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
-virtual void setCertDb( HCERTSTORE aCertDb ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
+HCERTSTORE getCertDb() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
+void setCertDb( HCERTSTORE aCertDb ) throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
 
-virtual void adoptSymKey( HCRYPTKEY aSymKey ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
-virtual HCRYPTKEY getSymKey( unsigned int position ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
+void adoptSymKey( HCRYPTKEY aSymKey ) throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
+HCRYPTKEY getSymKey( unsigned int position ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
 
-virtual HCRYPTKEY getPubKey( unsigned int position ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
+HCRYPTKEY getPubKey( unsigned int position ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
 
-virtual void enableDefaultCrypt( bool enable ) throw( 
css::uno::Exception , css::uno::RuntimeException ) ;
-virtual bool defaultEnabled() throw( css::uno::Exception , 
css::uno::RuntimeException ) ;
+void enableDefaultCrypt( bool enable ) throw( css::uno::Exception , 
css::uno::RuntimeException ) 

[Libreoffice-commits] core.git: 3 commits - xmlsecurity/source

2016-10-19 Thread Miklos Vajna
 xmlsecurity/source/pdfio/pdfdocument.cxx |   10 +-
 xmlsecurity/source/pdfio/pdfverify.cxx   |   22 --
 2 files changed, 29 insertions(+), 3 deletions(-)

New commits:
commit 365f2e9054c59da1515c52fe8852216ce678cf38
Author: Miklos Vajna 
Date:   Wed Oct 19 08:21:27 2016 +0200

cid#1374076 uncaught exception

Change-Id: Ifdbfc9f905f2ed7778830a0f2cc114d27feb36da

diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx 
b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 3b01578..6e807a4 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -1380,7 +1380,15 @@ bool PDFDocument::ValidateSignature(SvStream& rStream, 
PDFObjectElement* pSignat
 
 // Then convert this string to a local UNO DateTime.
 util::DateTime aUNODateTime;
-utl::ISO8601parseDateTime(aBuffer.toString(), aUNODateTime);
+try
+{
+utl::ISO8601parseDateTime(aBuffer.toString(), aUNODateTime);
+}
+catch (const std::length_error&)
+{
+SAL_WARN("xmlsecurity.pdfio", "PDFDocument::ValidateSignature: 
failed to parse signature date string");
+return false;
+}
 DateTime aDateTime(aUNODateTime);
 aDateTime.ConvertToLocalTime();
 rInformation.stDateTime = aDateTime.GetUNODateTime();
commit 90717e7d36e3ace7030efdc5007f086beaaeb52f
Author: Miklos Vajna 
Date:   Wed Oct 19 08:18:27 2016 +0200

cid#1374075 uncaught exception

Change-Id: I1c95efb37e62c5e600607d23e4e80bf430854cae

diff --git a/xmlsecurity/source/pdfio/pdfverify.cxx 
b/xmlsecurity/source/pdfio/pdfverify.cxx
index 15108d1..c751f20 100644
--- a/xmlsecurity/source/pdfio/pdfverify.cxx
+++ b/xmlsecurity/source/pdfio/pdfverify.cxx
@@ -44,7 +44,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(nArgc, pArgv)
 uno::Reference xMultiComponentFactory = 
xComponentContext->getServiceManager();
 uno::Reference 
xMultiServiceFactory(xMultiComponentFactory, uno::UNO_QUERY);;
 comphelper::setProcessServiceFactory(xMultiServiceFactory);
-uno::Reference xSEInitializer = 
xml::crypto::SEInitializer::create(xComponentContext);
+uno::Reference xSEInitializer;
+try
+{
+xSEInitializer = xml::crypto::SEInitializer::create(xComponentContext);
+}
+catch (const uno::DeploymentException& rException)
+{
+SAL_WARN("xmlsecurity.pdfio", "DeploymentException while creating 
SEInitializer: " << rException.Message);
+return 1;
+}
 uno::Reference xSecurityContext = 
xSEInitializer->createSecurityContext(OUString());
 
 OUString aInURL;
commit 6947962b085734fd313cbc055f18e62da9e73c8b
Author: Miklos Vajna 
Date:   Wed Oct 19 08:29:52 2016 +0200

cid#1374074 uncaught exception

Change-Id: Ibb734d394b49a032fab1dc1255376d6b7bb3632d

diff --git a/xmlsecurity/source/pdfio/pdfverify.cxx 
b/xmlsecurity/source/pdfio/pdfverify.cxx
index 5df1fff..15108d1 100644
--- a/xmlsecurity/source/pdfio/pdfverify.cxx
+++ b/xmlsecurity/source/pdfio/pdfverify.cxx
@@ -31,7 +31,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(nArgc, pArgv)
 }
 
 // Initialize nss / mscrypto.
-uno::Reference xComponentContext = 
cppu::defaultBootstrap_InitialComponentContext();
+uno::Reference xComponentContext;
+try
+{
+xComponentContext = cppu::defaultBootstrap_InitialComponentContext();
+}
+catch (const uno::RuntimeException& rException)
+{
+SAL_WARN("xmlsecurity.pdfio", 
"cppu::defaultBootstrap_InitialComponentContext() failed: " << 
rException.Message);
+return 1;
+}
 uno::Reference xMultiComponentFactory = 
xComponentContext->getServiceManager();
 uno::Reference 
xMultiServiceFactory(xMultiComponentFactory, uno::UNO_QUERY);;
 comphelper::setProcessServiceFactory(xMultiServiceFactory);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - xmlsecurity/source

2016-02-09 Thread Miklos Vajna
 xmlsecurity/source/helper/xsecctl.cxx |   68 ++
 xmlsecurity/source/helper/xsecctl.hxx |1 
 2 files changed, 69 insertions(+)

New commits:
commit 9ae891280af0eab73e29fbfa32ddc23d3fe6803e
Author: Miklos Vajna 
Date:   Tue Feb 9 10:42:31 2016 +0100

xmlsecurity: some streams should not be signed in OOXML export

At least that's what MSO does, probably intentionally.

Change-Id: I0722faaac4b9b93dad66753b8bb4f0e196adddf2

diff --git a/xmlsecurity/source/helper/xsecctl.cxx 
b/xmlsecurity/source/helper/xsecctl.cxx
index ea7bec1..0cd17a9 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -19,6 +19,8 @@
 
 
 #include "xsecctl.hxx"
+#include 
+#include 
 #include 
 
 #include 
@@ -976,6 +978,21 @@ void XSecController::exportSignature(
 xDocumentHandler->endElement( tag_Signature );
 }
 
+/// Should we intentionally not sign this stream?
+static bool lcl_isOOXMLBlacklist(const OUString& rStreamName)
+{
+#if !HAVE_BROKEN_STATIC_INITILIZER_LIST
+static
+#endif
+const std::initializer_list vBlacklist =
+{
+OUStringLiteral("%5BContent_Types%5D.xml"),
+OUStringLiteral("docProps/app.xml"),
+OUStringLiteral("docProps/core.xml")
+};
+return std::find(vBlacklist.begin(), vBlacklist.end(), rStreamName) != 
vBlacklist.end();
+}
+
 void XSecController::exportOOXMLSignature(const 
uno::Reference& xDocumentHandler, const 
SignatureInformation& rInformation)
 {
 xDocumentHandler->startElement(TAG_SIGNEDINFO, 
uno::Reference(new SvXMLAttributeList()));
@@ -1050,6 +1067,32 @@ void XSecController::exportOOXMLSignature(const 
uno::ReferenceAddAttribute(ATTR_ID, "idPackageObject");
 xDocumentHandler->startElement(TAG_OBJECT, 
uno::Reference(pAttributeList.get()));
 }
+xDocumentHandler->startElement(TAG_MANIFEST, 
uno::Reference(new SvXMLAttributeList()));
+for (const SignatureReferenceInformation& rReference : rReferences)
+{
+if (rReference.nType != SignatureReferenceType::SAMEDOCUMENT)
+{
+if (lcl_isOOXMLBlacklist(rReference.ouURI))
+continue;
+
+{
+rtl::Reference pAttributeList(new 
SvXMLAttributeList());
+pAttributeList->AddAttribute(ATTR_URI, rReference.ouURI);
+xDocumentHandler->startElement(TAG_REFERENCE, 
uno::Reference(pAttributeList.get()));
+}
+{
+rtl::Reference pAttributeList(new 
SvXMLAttributeList());
+pAttributeList->AddAttribute(ATTR_ALGORITHM, 
ALGO_XMLDSIGSHA256);
+xDocumentHandler->startElement(TAG_DIGESTMETHOD, 
uno::Reference(pAttributeList.get()));
+xDocumentHandler->endElement(TAG_DIGESTMETHOD);
+}
+xDocumentHandler->startElement(TAG_DIGESTVALUE, 
uno::Reference(new SvXMLAttributeList()));
+xDocumentHandler->characters(rReference.ouDigestValue);
+xDocumentHandler->endElement(TAG_DIGESTVALUE);
+xDocumentHandler->endElement(TAG_REFERENCE);
+}
+}
+xDocumentHandler->endElement(TAG_MANIFEST);
 xDocumentHandler->endElement(TAG_OBJECT);
 
 {
diff --git a/xmlsecurity/source/helper/xsecctl.hxx 
b/xmlsecurity/source/helper/xsecctl.hxx
index 9aad6c6..c7f5647 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -77,6 +77,7 @@
 #define TAG_OBJECT  "Object"
 #define TAG_SIGNATUREPROPERTIES "SignatureProperties"
 #define TAG_SIGNATUREPROPERTY   "SignatureProperty"
+#define TAG_MANIFEST "Manifest"
 #define TAG_TIMESTAMP   "timestamp"
 #define TAG_DATE"date"
 #define TAG_DESCRIPTION "description"
commit 5a9f81dadad52b36e5d148b07f721823b65d5aa0
Author: Miklos Vajna 
Date:   Tue Feb 9 10:39:59 2016 +0100

xmlsecurity: export OOXML 

Change-Id: I3f99cd51232e7c60bf72a79412e5ed0b08851ba7

diff --git a/xmlsecurity/source/helper/xsecctl.cxx 
b/xmlsecurity/source/helper/xsecctl.cxx
index fedbb5f..ea7bec1 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -1044,6 +1044,23 @@ void XSecController::exportOOXMLSignature(const 
uno::ReferenceendElement(TAG_X509CERTIFICATE);
 xDocumentHandler->endElement(TAG_X509DATA);
 xDocumentHandler->endElement(TAG_KEYINFO);
+
+{
+rtl::Reference pAttributeList(new 
SvXMLAttributeList());
+pAttributeList->AddAttribute(ATTR_ID, "idPackageObject");
+xDocumentHandler->startElement(TAG_OBJECT, 
uno::Reference(pAttributeList.get()));
+}
+xDocumentHandler->endElement(TAG_OBJECT);
+
+{
+rtl::Reference pAttributeList(new 
SvXMLAttributeList());
+pAttributeList->AddAttribute(ATTR_ID, "idOfficeObject");
+xDocumentHandler->startElement(TAG_OBJECT, 
uno::Reference(pAttributeList.get()));
+}
+

[Libreoffice-commits] core.git: 3 commits - xmlsecurity/source

2016-02-08 Thread Miklos Vajna
 xmlsecurity/source/helper/xsecctl.cxx  |   21 +++--
 xmlsecurity/source/helper/xsecctl.hxx  |2 +-
 xmlsecurity/source/helper/xsecsign.cxx |   33 +++--
 3 files changed, 43 insertions(+), 13 deletions(-)

New commits:
commit 1688228bec7f5cc4e7c252dea0ef5002bf26cec9
Author: Miklos Vajna 
Date:   Mon Feb 8 16:22:42 2016 +0100

xmlsecurity: export OOXML 

Change-Id: I7c5055e3bfaa81cae4c91842e9e3681d41d5c3b6

diff --git a/xmlsecurity/source/helper/xsecctl.cxx 
b/xmlsecurity/source/helper/xsecctl.cxx
index cffb298..dad4c39 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -1024,13 +1024,17 @@ void XSecController::exportOOXMLSignature(const 
uno::ReferenceendElement(TAG_DIGESTMETHOD);
 }
 xDocumentHandler->startElement(TAG_DIGESTVALUE, 
uno::Reference(new SvXMLAttributeList()));
-xDocumentHandler->endElement(TAG_DIGESTVALUE);
 xDocumentHandler->characters(rReference.ouDigestValue);
+xDocumentHandler->endElement(TAG_DIGESTVALUE);
 xDocumentHandler->endElement(TAG_REFERENCE);
 }
 }
 
 xDocumentHandler->endElement(TAG_SIGNEDINFO);
+
+xDocumentHandler->startElement(TAG_SIGNATUREVALUE, 
uno::Reference(new SvXMLAttributeList()));
+xDocumentHandler->characters(rInformation.ouSignatureValue);
+xDocumentHandler->endElement(TAG_SIGNATUREVALUE);
 }
 
 SignatureInformation XSecController::getSignatureInformation( sal_Int32 
nSecurityId ) const
commit dd641965351b2b83e4ffc7ba7a97ace318765dcb
Author: Miklos Vajna 
Date:   Mon Feb 8 16:12:58 2016 +0100

xmlsecurity: fix reference type of OOXML idSignedProperties

Change-Id: I5a2924c3c0af02a4630921bae6117f11655206c2

diff --git a/xmlsecurity/source/helper/xsecctl.cxx 
b/xmlsecurity/source/helper/xsecctl.cxx
index cd1f7e3..cffb298 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -1000,10 +1000,23 @@ void XSecController::exportOOXMLSignature(const 
uno::Reference pAttributeList(new 
SvXMLAttributeList());
-pAttributeList->AddAttribute("Type", 
"http://www.w3.org/2000/09/xmldsig#Object;);
+if (rReference.ouURI != "#idSignedProperties")
+pAttributeList->AddAttribute("Type", 
"http://www.w3.org/2000/09/xmldsig#Object;);
+else
+pAttributeList->AddAttribute("Type", 
"http://uri.etsi.org/01903#SignedProperties;);
 pAttributeList->AddAttribute(ATTR_URI, rReference.ouURI);
 xDocumentHandler->startElement(TAG_REFERENCE, 
uno::Reference(pAttributeList.release()));
 }
+if (rReference.ouURI == "#idSignedProperties")
+{
+xDocumentHandler->startElement(TAG_TRANSFORMS, 
uno::Reference(new SvXMLAttributeList()));
+std::unique_ptr pAttributeList(new 
SvXMLAttributeList());
+pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_C14N);
+xDocumentHandler->startElement(TAG_TRANSFORM, 
uno::Reference(pAttributeList.release()));
+xDocumentHandler->endElement(TAG_TRANSFORM);
+xDocumentHandler->endElement(TAG_TRANSFORMS);
+}
+
 {
 std::unique_ptr pAttributeList(new 
SvXMLAttributeList());
 pAttributeList->AddAttribute(ATTR_ALGORITHM, 
ALGO_XMLDSIGSHA256);
commit 349a0ddc316bfab61a0989eb7658fe82972fbd43
Author: Miklos Vajna 
Date:   Mon Feb 8 16:05:26 2016 +0100

xmlsecurity: write correct number of non-manifest OOXML references

Change-Id: I1d8556487608e5a0bee2ae5f7a4b25a60579f4a9

diff --git a/xmlsecurity/source/helper/xsecctl.hxx 
b/xmlsecurity/source/helper/xsecctl.hxx
index a67dc34..9aad6c6 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -356,7 +356,7 @@ private:
 static OUString createId();
 com::sun::star::uno::Reference<
 com::sun::star::xml::crypto::sax::XReferenceResolvedListener > 
prepareSignatureToWrite(
-InternalSignatureInformation& signatureInfo );
+InternalSignatureInformation& signatureInfo, sal_Int32 nStorageFormat 
= 0 );
 
 /*
  * For signature verification
diff --git a/xmlsecurity/source/helper/xsecsign.cxx 
b/xmlsecurity/source/helper/xsecsign.cxx
index 4f1e523..778381e 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -58,7 +59,7 @@ OUString XSecController::createId()
 }
 
 cssu::Reference< cssxc::sax::XReferenceResolvedListener > 
XSecController::prepareSignatureToWrite(
-InternalSignatureInformation& internalSignatureInfor )
+InternalSignatureInformation& internalSignatureInfor, sal_Int32 

[Libreoffice-commits] core.git: 3 commits - xmlsecurity/source

2016-02-08 Thread Miklos Vajna
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |3 +
 xmlsecurity/source/helper/xsecctl.cxx  |   41 -
 xmlsecurity/source/helper/xsecctl.hxx  |2 
 3 files changed, 45 insertions(+), 1 deletion(-)

New commits:
commit 570d5af407d55c39621575e56c77817dbd429783
Author: Miklos Vajna 
Date:   Mon Feb 8 15:00:21 2016 +0100

xmlsecurity: initial OOXML support for writing same-document references

They are kind of a special case for ODF, but OOXML uses these
exclusively, and then one of them refers to the actual package streams.

Change-Id: I4663eef4bd718a7563effd6cafa790126db6d8c7

diff --git a/xmlsecurity/source/helper/xsecctl.cxx 
b/xmlsecurity/source/helper/xsecctl.cxx
index 81b8d97..cd1f7e3 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -975,7 +975,7 @@ void XSecController::exportSignature(
 xDocumentHandler->endElement( tag_Signature );
 }
 
-void XSecController::exportOOXMLSignature(const 
uno::Reference& xDocumentHandler, const 
SignatureInformation& /*rInformation*/)
+void XSecController::exportOOXMLSignature(const 
uno::Reference& xDocumentHandler, const 
SignatureInformation& rInformation)
 {
 xDocumentHandler->startElement(TAG_SIGNEDINFO, 
uno::Reference(new SvXMLAttributeList()));
 
@@ -993,6 +993,30 @@ void XSecController::exportOOXMLSignature(const 
uno::ReferenceendElement(TAG_SIGNATUREMETHOD);
 }
 
+const SignatureReferenceInformations& rReferences = 
rInformation.vSignatureReferenceInfors;
+for (const SignatureReferenceInformation& rReference : rReferences)
+{
+if (rReference.nType == SignatureReferenceType::SAMEDOCUMENT)
+{
+{
+std::unique_ptr pAttributeList(new 
SvXMLAttributeList());
+pAttributeList->AddAttribute("Type", 
"http://www.w3.org/2000/09/xmldsig#Object;);
+pAttributeList->AddAttribute(ATTR_URI, rReference.ouURI);
+xDocumentHandler->startElement(TAG_REFERENCE, 
uno::Reference(pAttributeList.release()));
+}
+{
+std::unique_ptr pAttributeList(new 
SvXMLAttributeList());
+pAttributeList->AddAttribute(ATTR_ALGORITHM, 
ALGO_XMLDSIGSHA256);
+xDocumentHandler->startElement(TAG_DIGESTMETHOD, 
uno::Reference(pAttributeList.release()));
+xDocumentHandler->endElement(TAG_DIGESTMETHOD);
+}
+xDocumentHandler->startElement(TAG_DIGESTVALUE, 
uno::Reference(new SvXMLAttributeList()));
+xDocumentHandler->endElement(TAG_DIGESTVALUE);
+xDocumentHandler->characters(rReference.ouDigestValue);
+xDocumentHandler->endElement(TAG_REFERENCE);
+}
+}
+
 xDocumentHandler->endElement(TAG_SIGNEDINFO);
 }
 
diff --git a/xmlsecurity/source/helper/xsecctl.hxx 
b/xmlsecurity/source/helper/xsecctl.hxx
index 589183d..a67dc34 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -97,6 +97,7 @@
 #define ALGO_RSASHA1"http://www.w3.org/2000/09/xmldsig#rsa-sha1;
 #define ALGO_RSASHA256 "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256;
 #define ALGO_XMLDSIGSHA1"http://www.w3.org/2000/09/xmldsig#sha1;
+#define ALGO_XMLDSIGSHA256 "http://www.w3.org/2001/04/xmlenc#sha256;
 #define ALGO_RELATIONSHIP 
"http://schemas.openxmlformats.org/package/2006/RelationshipTransform;
 
 #define CHAR_FRAGMENT   "#"
commit 5138223ebf7e4bfa6bd13be1b195ff1a7f03c017
Author: Miklos Vajna 
Date:   Mon Feb 8 14:13:23 2016 +0100

xmlsecurity: log temporary OOXML storage location during export

This can be inspected after the add button handler finishes, but the
dialog is still alive.

Change-Id: I18ece31545de6d306a26b44d372f54df8221a456

diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx 
b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 58fb01f..30a805e 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -530,6 +530,9 @@ IMPL_LINK_NOARG_TYPED(DigitalSignaturesDialog, 
AddButtonHdl, Button*, void)
 xTransact->commit();
 uno::Reference 
xOutputStream(aStreamHelper.xSignatureStream, uno::UNO_QUERY);
 xOutputStream->closeOutput();
+
+uno::Reference 
xTempFile(aStreamHelper.xSignatureStream, uno::UNO_QUERY);
+SAL_INFO("xmlsecurity.dialogs", "AddButtonHdl: temporary 
storage is at " << xTempFile->getUri());
 }
 
 maSignatureHelper.EndMission();
commit 7ff681fddaeff5cea22a1978bd4916e0c6bc28f9
Author: Miklos Vajna 
Date:   Mon Feb 8 14:09:45 2016 +0100

xmlsecurity: export OOXML 

Change-Id: I445a50d5c7d12609e4043bfedc41cdea456fa52f

diff --git