sw/source/core/doc/textboxhelper.cxx | 8 +++++--- xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk | 1 + xmlsecurity/CppunitTest_xmlsecurity_signing.mk | 1 + xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx | 5 ++++- xmlsecurity/qa/unit/signing/signing.cxx | 5 ++++- 5 files changed, 15 insertions(+), 5 deletions(-)
New commits: commit f22f3135d10df9ad4250185b9c67db25e53e9a7f Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Dec 17 13:41:33 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Jan 12 13:14:23 2025 +0100 xmlsecurity: fix tests to run with system NSS on Fedora 40 testDropMacroTemplateSignature fails printing this: warn:xmlsecurity.xmlsec:3511616:3511616:xmlsecurity/source/xmlsec/errorcallback.cxx:53: signatures.c:599: xmlSecNssSignatureSetKey() 'rsa-sha1' 'VFY_CreateContext' 4 'NSS error: -8011' because policy sets NSS_RSA_MIN_KEY_SIZE to 2048. testPDFGood fails printing this: warn:svl.crypto:3587940:3587940:svl/source/crypto/cryptosign.cxx:1941: ValidateSignature: message is not signed warn:xmlsecurity.helper:3587940:3587940:xmlsecurity/source/helper/pdfsignaturehelper.cxx:482: failed to determine digest match because enabling SEC_OID_SHA1 for NSS_USE_ALG_IN_ANY_SIGNATURE doesn't enable it for SMIME signatures, so smime_allowed_by_policy() fails - obviously one has to use NSS_USE_ALG_IN_SIGNATURE to enable it in any signature. Change-Id: I59ffaf0994eee6b51362fd3296f61465d0fc7903 (cherry picked from commit a7b7b00b78426bff8607c77106ea62dd213f0821) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178663 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit fae1eb775d44438a2193ba1ec07261ea0a94fef4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178668 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk index 667acc97e3e1..67ba9ec124fa 100644 --- a/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk +++ b/xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk @@ -38,6 +38,7 @@ ifneq ($(OS),WNT) ifneq (,$(ENABLE_NSS)) $(eval $(call gb_CppunitTest_use_externals,xmlsecurity_pdfsigning,\ nssutil3 \ + nss3 \ )) endif endif diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk index 37d1c2a7dea7..87dae0916902 100644 --- a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk +++ b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk @@ -43,6 +43,7 @@ ifneq ($(OS),WNT) ifneq (,$(ENABLE_NSS)) $(eval $(call gb_CppunitTest_use_externals,xmlsecurity_signing,\ nssutil3 \ + nss3 \ )) endif endif diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx index 9d774735d30c..6f0636a9e5e1 100644 --- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx +++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx @@ -13,6 +13,7 @@ #if USE_CRYPTO_NSS #include <secoid.h> +#include <nss.h> #endif #include <string_view> @@ -80,7 +81,9 @@ void PDFSigningTest::setUp() #ifdef NSS_USE_ALG_IN_ANY_SIGNATURE // policy may disallow using SHA1 for signatures but unit test documents // have such existing signatures (call this after createSecurityContext!) - NSS_SetAlgorithmPolicy(SEC_OID_SHA1, NSS_USE_ALG_IN_ANY_SIGNATURE, 0); + NSS_SetAlgorithmPolicy(SEC_OID_SHA1, NSS_USE_ALG_IN_SIGNATURE, 0); + // the minimum is 2048 in Fedora 40 + NSS_OptionSet(NSS_RSA_MIN_KEY_SIZE, 1024); #endif #endif } diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 4d787529f9a8..07ccfd572e3f 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -15,6 +15,7 @@ #if USE_CRYPTO_NSS #include <secoid.h> +#include <nss.h> #endif #include <test/unoapixml_test.hxx> @@ -104,7 +105,9 @@ void SigningTest::setUp() #ifdef NSS_USE_ALG_IN_ANY_SIGNATURE // policy may disallow using SHA1 for signatures but unit test documents // have such existing signatures (call this after createSecurityContext!) - NSS_SetAlgorithmPolicy(SEC_OID_SHA1, NSS_USE_ALG_IN_ANY_SIGNATURE, 0); + NSS_SetAlgorithmPolicy(SEC_OID_SHA1, NSS_USE_ALG_IN_SIGNATURE, 0); + // the minimum is 2048 in Fedora 40 + NSS_OptionSet(NSS_RSA_MIN_KEY_SIZE, 1024); #endif #endif } commit 9f91903da9a0452c7d718274e43d9827a0661144 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Nov 18 16:50:45 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Jan 12 13:14:08 2025 +0100 tdf#163486: PVS: dereferencing of a potential null pointer V522 There might be dereferencing of a potential null pointer. Change-Id: I23e4eba0399243ca67ecaa3101a327eece825687 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176722 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176744 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 184466498e24..a9179dfe10b6 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -1583,9 +1583,11 @@ bool SwTextBoxHelper::DoTextBoxZOrderCorrection(SwFrameFormat* pShape, const Sdr SdrObject* pFrmObj = pTextBox->FindRealSdrObject(); if (!pFrmObj) { - // During loading there is no ready SdrObj for z-ordering, so create and cache it here - pFrmObj - = SwXTextFrame::GetOrCreateSdrObject(*dynamic_cast<SwFlyFrameFormat*>(pTextBox)); + if (SwFlyFrameFormat* pFlyFrameFormat = dynamic_cast<SwFlyFrameFormat*>(pTextBox)) + { + // During loading there is no ready SdrObj for z-ordering, so create and cache it here + pFrmObj = SwXTextFrame::GetOrCreateSdrObject(*pFlyFrameFormat); + } } if (pFrmObj) {