[Libreoffice-commits] core.git: 3 commits - xmlsecurity/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Oct 19 06:32:48 UTC 2016
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 <vmiklos at collabora.co.uk>
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 <vmiklos at collabora.co.uk>
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<lang::XMultiComponentFactory> xMultiComponentFactory = xComponentContext->getServiceManager();
uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xMultiComponentFactory, uno::UNO_QUERY);;
comphelper::setProcessServiceFactory(xMultiServiceFactory);
- uno::Reference<xml::crypto::XSEInitializer> xSEInitializer = xml::crypto::SEInitializer::create(xComponentContext);
+ uno::Reference<xml::crypto::XSEInitializer> 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<xml::crypto::XXMLSecurityContext> xSecurityContext = xSEInitializer->createSecurityContext(OUString());
OUString aInURL;
commit 6947962b085734fd313cbc055f18e62da9e73c8b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
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<uno::XComponentContext> xComponentContext = cppu::defaultBootstrap_InitialComponentContext();
+ uno::Reference<uno::XComponentContext> 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<lang::XMultiComponentFactory> xMultiComponentFactory = xComponentContext->getServiceManager();
uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xMultiComponentFactory, uno::UNO_QUERY);;
comphelper::setProcessServiceFactory(xMultiServiceFactory);
More information about the Libreoffice-commits
mailing list