[Libreoffice-commits] core.git: offapi/com sfx2/source xmlsecurity/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 9 11:48:19 UTC 2018
offapi/com/sun/star/security/DocumentSignatureInformation.idl | 1 +
sfx2/source/dialog/dinfdlg.cxx | 2 +-
xmlsecurity/source/component/documentdigitalsignatures.cxx | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 015e4266a82ead8135458bd07f01838222521eea
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Nov 8 21:39:16 2018 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Nov 9 12:44:49 2018 +0100
css::security::DocumentSignatureInformation::SignatureTime is 32 bit
...and has always represented the time of day in 100th of seconds. When
tools::Time had been changed to 64 bit nanoseconds in
9830fd36dbdb72c79703b0c61efc027fba793c5a "date/time IDL datatypes incompatible
change", conversion between the two has apparently been forgotten, so that
CppunitTest_desktop_lib under (new-in-Clang)
-fsanitize=implicit-signed-integer-truncation failed with
> xmlsecurity/source/component/documentdigitalsignatures.cxx:536:38: runtime error: implicit conversion from type 'sal_Int64' (aka 'long') of value 192536379741069 (64-bit, signed) to type '::sal_Int32' (aka 'int') changed the value to 1585795981 (32-bit, signed)
> #0 in DocumentDigitalSignatures::ImplVerifySignatures(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, DocumentSignatureMode) at xmlsecurity/source/component/documentdigitalsignatures.cxx:536:38 (instdir/program/libxmlsecurity.so +0x488319)
> #1 in DocumentDigitalSignatures::verifyDocumentContentSignatures(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&) at xmlsecurity/source/component/documentdigitalsignatures.cxx:296:12 (instdir/program/libxmlsecurity.so +0x484ea6)
> #2 in non-virtual thunk to DocumentDigitalSignatures::verifyDocumentContentSignatures(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&) at xmlsecurity/source/component/documentdigitalsignatures.cxx (instdir/program/libxmlsecurity.so +0x4890fa)
> #3 in SfxObjectShell::ImplAnalyzeSignature(bool, com::sun::star::uno::Reference<com::sun::star::security::XDocumentDigitalSignatures> const&) at sfx2/source/doc/objserv.cxx:1368:47 (instdir/program/libsfxlo.so +0x3866a04)
> #4 in SfxObjectShell::ImplGetSignatureState(bool) at sfx2/source/doc/objserv.cxx:1397:74 (instdir/program/libsfxlo.so +0x3869118)
> #5 in SfxObjectShell::GetDocumentSignatureState() at sfx2/source/doc/objserv.cxx:1575:12 (instdir/program/libsfxlo.so +0x3863e57)
> #6 in SfxObjectShell::CheckForBrokenDocSignatures_Impl() at sfx2/source/doc/objmisc.cxx:974:38 (instdir/program/libsfxlo.so +0x3812535)
> #7 in SfxObjectShell::CheckSecurityOnLoading_Impl() at sfx2/source/doc/objmisc.cxx:924:5 (instdir/program/libsfxlo.so +0x38120bc)
> #8 in SfxObjectShell::FinishedLoading(SfxLoadedFlags) at sfx2/source/doc/objmisc.cxx:1072:9 (instdir/program/libsfxlo.so +0x3818a89)
> #9 in SwDocShell::LoadingFinished() at sw/source/uibase/app/docsh.cxx:1200:5 (instdir/program/libswlo.so +0xcfd4f08)
> #10 in SwDocShell::Load(SfxMedium&) at sw/source/uibase/app/docshini.cxx:582:13 (instdir/program/libswlo.so +0xd091a39)
> #11 in SfxObjectShell::LoadOwnFormat(SfxMedium&) at sfx2/source/doc/objstor.cxx:3053:20 (instdir/program/libsfxlo.so +0x3895e54)
> #12 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:725:40 (instdir/program/libsfxlo.so +0x389bdd5)
> #13 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1795:36 (instdir/program/libsfxlo.so +0x3a40e1e)
> #14 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:688:28 (instdir/program/libsfxlo.so +0x40c30c0)
> #15 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1149:37 (instdir/program/libfwklo.so +0x1520131)
> #16 in framework::LoadEnv::startLoading() at framework/source/loadenv/loadenv.cxx:383:20 (instdir/program/libfwklo.so +0x1510b16)
> #17 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/loadenv/loadenv.cxx:169:14 (instdir/program/libfwklo.so +0x150c7c8)
> #18 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:619:12 (instdir/program/libfwklo.so +0x166f1ce)
> #19 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx (instdir/program/libfwklo.so +0x166f3da)
> #20 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:50:60 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x8f176)
> #21 in DesktopLOKTest::loadDoc(char const*, LibreOfficeKitDocumentType) at desktop/qa/desktop_lib/test_desktop_lib.cxx:215:19 (workdir/LinkTarget/CppunitTest/libtest_desktop_lib.so +0xf2ca0)
> #22 in DesktopLOKTest::testGetSignatureState_Signed() at desktop/qa/desktop_lib/test_desktop_lib.cxx:2254:37 (workdir/LinkTarget/CppunitTest/libtest_desktop_lib.so +0x185a42)
[...]
Change-Id: I935f2e37ce6bcb0448f89e75a4f34f78ba54f58d
Reviewed-on: https://gerrit.libreoffice.org/63136
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/offapi/com/sun/star/security/DocumentSignatureInformation.idl b/offapi/com/sun/star/security/DocumentSignatureInformation.idl
index 99c14af09eb9..f3e891a37378 100644
--- a/offapi/com/sun/star/security/DocumentSignatureInformation.idl
+++ b/offapi/com/sun/star/security/DocumentSignatureInformation.idl
@@ -40,6 +40,7 @@ struct DocumentSignatureInformation
{
XCertificate Signer;
long SignatureDate;
+ /** Time of day, in 100th of seconds. */
long SignatureTime;
boolean SignatureIsValid;
/**
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index a22ebdc6087c..9f11b03295bd 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -710,7 +710,7 @@ namespace
const LocaleDataWrapper& rWrapper( Application::GetSettings().GetLocaleDataWrapper() );
Date aDate( _nDate );
- tools::Time aTime( _nTime );
+ tools::Time aTime( _nTime * tools::Time::nanoPerCenti );
OUString aStr = rWrapper.getDate( aDate )
+ ", "
+ rWrapper.getTime( aTime );
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index d19f6bd854e0..19f46e45e23d 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -533,7 +533,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
tools::Time aTime( rInfo.stDateTime.Hours, rInfo.stDateTime.Minutes,
rInfo.stDateTime.Seconds, rInfo.stDateTime.NanoSeconds );
rSigInfo.SignatureDate = aDate.GetDate();
- rSigInfo.SignatureTime = aTime.GetTime();
+ rSigInfo.SignatureTime = aTime.GetTime() / tools::Time::nanoPerCenti;
rSigInfo.SignatureIsValid = ( rInfo.nStatus == css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED );
More information about the Libreoffice-commits
mailing list