summaryrefslogtreecommitdiff
path: root/xmlsecurity/qa
AgeCommit message (Collapse)Author
18 hourscool#10630 doc electronic sign: fix insertion of the signature lineMiklos Vajna
Have electronic signing configured in the LOK client, try to insert a signature line, you'll get a certificate picker, while we don't have a cert during esign. What's in fact needed for creating the signature line is just a name (previously extracted from the certificate), we can survive the lack of actual certificate. Fix the problem by adding a new External parameter to .uno:InsertSignatureLine to hint that the certificate chooser should not be opened, instead the editor name (used for comments already) should be used. Add a new CertificateOrName in svl/ and use that in all places where previously we wanted a certificate but in fact it's enough to have a certificate or a name to create the signature line. The name on the signature line is just visual feedback, the actual name on the crypto signature is still not based on untrusted used input. Change-Id: Ib7008112a8e28a9e7d9649745e6021dd6b6b9c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180193 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
7 daysxmlsecurity: fix CppunitTest_xmlsecurity_xmlsec with F41 system NSSMichael Stahl
xmlsecurity/qa/xmlsec/xmlsec.cxx:102:(anonymous namespace)::testInsertPrivateKey::TestBody equality assertion failed - Expected: 1 - Actual : 0 Just copying the NSS setup code from the other tests lets the test pass. Also sync all the copies of the setup code while at it. Change-Id: Idcaebec4dff29f37e0ed0f05d6d7d62782947325 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179893 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-12-17xmlsecurity: fix tests to run with system NSS on Fedora 40Michael Stahl
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.stahl@allotropia.de>
2024-11-11cool#9992 lok doc sign, hash extract: time for getCommandValues('Signature')Miklos Vajna
The final goal of this API is to give time & hash information about the PDF signature, so once a 3rd-party produces the PKCS#7 signature, that can be added to the document and the actual PDF sign can be re-run with the same parameters. This commit continues the replacement of XCertificate with svl::crypto::SigningContext up to the point that the timestamp used in svl/ can be exposed on the LOK API. This is done by updating DocumentSignatureManager::add(), PDFSignatureHelper::SetX509Certificate(), vcl::filter::PDFDocument::Sign() and finally the svl::crypto::Signing ctor to work with the signing context instead of an XCertificate directly. Time reporting works now, so add a test for that. The digest part still needs doing. Change-Id: I83f1274cd420b67194b7caf12b1027e623d4f7fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176404 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-11-08cool#9992 lok doc sign, hash extract: initial getCommandValues('Signature')Miklos Vajna
The trouble with signing via ca/cert/key PEM files is that usually the CA is not trusted by the received of the signature. 3rd-party services are available to do generate trusted signatures, but then you need to share your document with them, which can be also problematic. A middle-ground here is to sign the hash of the document by a 3rd-party, something that's supported by e.g. <https://docs.eideasy.com/electronic-signatures/api-flow-with-file-hashes-pdf.html> (which itself aggregates a number of providers). As a first step, add LOK API to get what would be the signature time during signing -- but instead of actually signing, just return this information. Once the same is done with the doc hash, this is supposed to provide the same info than what the reference <https://github.com/eideasy/eideasy-external-pades-digital-signatures> app does. This is only a start: incrementally replace XCertificate with SignatureContext, which allows aborting the signing right before calling into NSS, and also later it'll allow injecting the PKCS#7 object we get from the 3rd-party. Change-Id: I108564f047fdb4fb796240c7d18a584cd9044313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176279 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-11-06cool#9992 lok doc sign, create-certs.sh password-less mode: still create a .p12Miklos Vajna
I have a case where LOK convert-to with ODT->PDF and SignCertificateCaPem/SignCertificateCertPem/SignCertificateKeyPem set creates a corrupted PDF signature, while more or less the same on the desktop works. The PDF signature is a hex dump, and once converted to binary, one can analyze the content using 'openssl asn1parse -inform der -in ... -i'. Still, the LOK and the desktop case differs, because this script generates random certificates and then the binary output in the two cases differs, so hard to see the actual difference. Fix the problem by still generating .p12 output (needed for the desktop case) in the no-password case, so a single run can emit ca/cert/key PEM files and a .p12 archive, so exactly the same input can be used for desktop and LOK signing. It turns out the actual problem I looked at was some setup problem, because now that the same input can be used in the two cases, the LOK signing during PDF export works fine. Change-Id: Ifc5ff73cd6fbbc057af536c84e4367ce1d489931 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176081 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-11-04new loplugin:staticconstexprNoel Grandin
Change-Id: Ida1996dfffa106bf95fd064e8191b8033b4002f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-02tdf#163738 use insert function instead of for loopChris Gill
In the unit test CppunitTest_xmlsecurity_pdfsigning use std::vector::insert() in place of a for loop. Change-Id: Ib51f0ec6932210befe3c7aad9a6b5c8989bfe839 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175337 Tested-by: Jenkins Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2024-10-29UnoApiTest: rename load to loadFromURL and use it everywhereXisco Fauli
Change-Id: Ie67eebec74f783fa0c29acfb23bb83bc582812b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175724 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-10-05Use good old string literals in assertXPath and friendsMike Kaganski
These are only sent to an external API expecting char*-like strings, or for comparison. Having every assertXPath having three of _[ou]str is too much syntactic noise, making the unit tests almost unreadable. Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-10-02qa: use SetODFDefaultVersion everywhereXisco Fauli
Change-Id: I4a08abea9a6c61a0365d238abf1021806ae6df29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174375 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-02Add ODF 1.3 Extended / ODF 1.4 versions to configuration and UIXisco Fauli
The new default is ODF 1.4 Extended Change-Id: I50f60cccde81b5ea320478314482cc67a7bcc2e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174343 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-09-25Fix typoAndrea Gelmini
Change-Id: Id1e54ad708501733282851b6538bc946119742b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173934 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-09-25cool#9992 lok doc sign: fix import of the private keyMiklos Vajna
Once the signing key is taken from the matching SfxViewShell (not yet done), signing with a certificate specified via initializeForRendering() failed with: warn:xmlsecurity.xmlsec:13020:13005:xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx:330: X509Certificate_NssImpl::getPrivateKey() cannot find private key warn:xmlsecurity.xmlsec:13020:13005:xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:812: Can't get the private key from the certificate. warn:xmlsecurity.xmlsec:13020:13005:xmlsecurity/source/xmlsec/errorcallback.cxx:53: keys.c:1347: xmlSecKeysMngrGetKey() '' '' 45 'details=NULL' warn:xmlsecurity.xmlsec:13020:13005:xmlsecurity/source/xmlsec/errorcallback.cxx:53: xmldsig.c:822: xmlSecDSigCtxProcessKeyInfoNode() '' '' 45 'details=NULL' warn:xmlsecurity.xmlsec:13020:13005:xmlsecurity/source/xmlsec/errorcallback.cxx:53: xmldsig.c:537: xmlSecDSigCtxProcessSignatureNode() '' 'xmlSecDSigCtxProcessKeyInfoNode' 1 ' ' warn:xmlsecurity.xmlsec:13020:13005:xmlsecurity/source/xmlsec/errorcallback.cxx:53: xmldsig.c:301: xmlSecDSigCtxSign() '' 'xmlSecDSigCtxProcessSignatureNode' 1 ' ' The trouble was that we wanted to keep the private key in-memory, presumably because initially the whole NSS database was in-memory for the LOK case. This was changed in commit 87eec1b90b6ecd83455f09168430c23f73c25c86 (NSS: create a temporary database instead of in-memory, 2018-12-31), so there is no problem with a not-in-memory private key anymore. Note that the problematic codepath was only triggered when first the certificate chooser was ran and only then we signed. So the testcase also gets the cert flags before signing, otherwise the test would succeed even without the fix. Change-Id: I5086b205c91b630ddd343c0eb91bd9e63b3ea238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173892 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-09-24Let test operate on temp copy of source documentStephan Bergmann
The CppunitTest_xmlsecurity_signing CPPUNIT_TEST_NAME=testImplicitScriptSign::TestBody introduced in e5a0209d4b1e1f09191a442e04d626b21c49b9df "cool#9992 lok doc sign: allow sign of macros & the document itself in one step" failed on a read-only source tree with > An uncaught UNO exception > - com.sun.star.ucb.InteractiveAugmentedIOException: {Message: "an error occurred during file opening (18/28) at /home/libo/src/core/ucbhelper/source/provider/cancelcommandexecution.cxx:83", Context: @0x7ff5cb43cf90, Classification: com.sun.star.task.InteractionClassification 0, Code: com.sun.star.ucb.IOErrorCode 1, Arguments: [com.sun.star.beans.PropertyValue: {Name: "Uri", Handle: -1, Value: string: "file:///home/libo/src/core//xmlsecurity/qa/unit/signing/data//macro.odt", State: com.sun.star.beans.PropertyState 0}, com.sun.star.beans.PropertyValue: {Name: "ResourceName", Handle: -1, Value: string: "/home/libo/src/core//xmlsecurity/qa/unit/signing/data//macro.odt", State: com.sun.star.beans.PropertyState 0}]} Change-Id: I9198ca1eba03d55e745a0bbb344963139941496f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173852 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-09-19cool#9992 lok doc sign: add password-less mode to create-certs.shMiklos Vajna
Now one can use './create-certs.sh RSA NOPASS' to create signing certs without encrypting them with a password. This is meant to be useful for the case when these certs have to be imported using the LOK API, and not interactively in Firefox, where one could ask for a password. Change-Id: I4cfc49ac8ff8c2420baa943b553a7a180a71e3bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173651 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-09-18xmlsecurity: add unit test with docx that can only be opened with repairMichael Stahl
Change-Id: I4f705dd2124383a90b69d04d8b2de0e37f83a495 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170053 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-09-12cool#9992 lok doc sign: allow sign of macros & the document itself in one stepMiklos Vajna
Sign a document with macros (via file -> digital signatures -> digital signatures), realize that you still get a warning on file open, sign the macros in the document (via tools -> macros -> digital signature), realize that you did this in the wrong order, so now you have to re-sign the doc content. The reason for this is that the macro signature only signs the macro parts of the document (so you can still edit the document and the signature is valid, as long as you don't touch macros), while the doc content signature signs everything, including the macro signature, so the order of the two matters. Solve this trouble by adding a new setting that allows doing the two signatures in one step. Do this by extending the doc content signing code with an optional pre-step that first signs the document macros. This is a bit tricky to do, since xmlsecurity/ gets an RW signature stream and a RO document storage from sfx2/, but transferring one more signature stream can solve this trouble. Other tricky parts of the change: 1) The crypto signing is always done by libxmlsec, so DigitalSignaturesDialog::SetScriptingSignatureStream() has to update the storage of the sign manager's sign helper, otherwise, the hashes in the macro signature will be empty. 2) Signing reads the RO storage, so normally the macro signature would not be part of the doc signature when creating both signatures inside a single dialog. (The storage is only committed after the dialog ends.) Fix this problem by extending DocumentSignatureManager::add() and UriBindingHelper::OpenInputStream() to provide kind of an overlay when xmlsecurity/ gets a script signature stream: this way the macro signature will be part of the doc signature while the dialog is in progress. No overlay is needed later, once both streams are committed to the storage on dialog end. Change-Id: Ic2728689997165595991d5ec59c7a2683286e22d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173263 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-08-15Fix the test failing when invalid certificate is in cert storeMike Kaganski
testPDFAddVisibleSignature was failing for me locally because of an expired certificate present in my store. Change-Id: I03243f6707b1b5ca94ea87e9f8c809dd47b6a93a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171901 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-08-15Use MacrosTest::IsValid to check certificatesMike Kaganski
Change-Id: I015fae42cf95ab7ff4f384b17f6ac4994d4c81ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171902 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-08-05Fix typoAndrea Gelmini
Change-Id: I5cef95873cd6a67ba2994dcb6c2c8ed231c0b2ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171494 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-08-05tdf#159040 tdf#162206: better the user key selection and test sign with defaultSarper Akdemir
fix GPG CertificateImpl::getSHA1Thumbprint not returning a sequence of bytes as the thumbprint. (that is what the documented API states, and what all of the code assumed.) now /org.openoffice.UserProfile/Data/signingkey and encryptionkey stores the key's SHA1Thumbprint for better identification of keys. Previously on the key name was being used. fix annoying NSS Certificate Database password prompt appearing on Tools->Options if the certificate database is password protected. improve Tools->Options->UserData user key selection and display of information. add a ui test for "Sign with default certificate" interaction in the save dialog. Change-Id: I1036856003f58f494838e0f81ca0fe18e821f528 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171395 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
2024-08-01pyuno,unotest,xmlsecurity: copy GPG test files for UITtestMichael Stahl
The problem was that running UITest_xmlsecurity_gpg changed the files in test/signing-keys/ ... prevent that by copying the directory in that test, which is more complicated than initially expected. Change-Id: Ie3be922e0b2e9dae49f9a70e35ad5270c90b4fc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171322 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2024-07-29testtools, wizards, xmlsecurity: fix issues found by Ruff linterIlmari Lauhakangas
Change-Id: I03edbaa7c9a643ca7503fa0e93c2bf0de3ac4e51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171211 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-07-25CppunitTest_xmlsecurity_signing: simplify a bitXisco Fauli
Change-Id: I197e37f6520644c594baa6936d831ea456d60f69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171051 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-07-18make date/time single-arg constructors explicitNoel Grandin
Change-Id: I943f755d95b90ef8aeb7d5b339f617ff50db4e29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170673 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-17xmlsecurity: Add UItest (save GPG encrypted ODF)Moritz Duge
Change-Id: I09dd13334e0d3da5f6004312bae69b5c77120434 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167904 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-07-02BootstrapFixture: get rid of mxComponentContextXisco Fauli
Change-Id: I0318485c3c0159277e47096e0c7e0df8ed109ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169865 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-16WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara
Change-Id: I710ff75d387b2d452cb80911c9f0092948453ef8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167751 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-05-15loplugin:ostr in xmlsecurityNoel Grandin
Change-Id: Ifb936c230f68447b3bb5993705adb5e5b790371f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167668 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-03-28tdf#146619 Remove unused #includes from C/C++ filesRafał Dobrakowski
'xmlsecurity' module was cleaned. Add some headers from xmlsec-wrapper.h in preparation for its removal Change-Id: Id66e6d40d4d5d980626832c0e2f6255fc31b4bcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164639 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-01-30tdf#105844 unotest,xmlsecurity: fix tests on MacOSXMichael Stahl
The new tests fail with: > core/xmlsecurity/qa/unit/signing/signing2.cxx: > 252: Assertion > Test name: testPasswordPreserveMacroSignatureODFWholesomeLO242::TestBody > equality assertion failed > - Expected: 1 > - Actual : 4 This is because only the first test that runs sees the testing CA certificates that are copied in MacrosTest::setUpNssGpg(); when the second test runs, they have somehow vanished. This is because apparently SQLite on MacOSX, unlike on Linux, monitors the file descriptors of its database files, and then invalidates itself when setUpNssGpg() via osl::File::copy() renames and unlinks the existing database files: > cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode renamed while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/cert9.db.osl-tmp > cppunittester[29873:5483181] [logging] invalidated open fd: 5 (0x20) > cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/cert9.db.osl-tmp > cppunittester[29873:5483181] [logging] invalidated open fd: 5 (0x11) > cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode renamed while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/key4.db.osl-tmp > cppunittester[29873:5483181] [logging] invalidated open fd: 6 (0x20) > cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/key4.db.osl-tmp > cppunittester[29873:5483181] [logging] invalidated open fd: 6 (0x11) Split MacrosTest::setUpNssGpg()/tearDownNssGpg() into functions setUpX509() which only does something on the 1st invocation, and setUpGpg()/tearDownGpg() which may be invoked per-test (they could also be run once for the whole test suite, but not obvious how to do that); PDF related tests don't need GPG. Presumably this is (along with the WNT-specific problem fixed in commit 3e9a700091872480dd085f0928d1d30b7d74cfd7) the reason why most of the tests not only accept the expected result of SignatureState::OK but also SignatureState::NOTVALIDATED. Change-Id: I59b85ca651cecaccfdea729ed1e645c53079c8bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162693 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-23Make wholesome ODF package encryption the defaultThorsten Behrens
Change-Id: I825ae7a5e4b80d390804a7bb2cfdfc3b1843bd07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162066 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-01-11Fix typoAndrea Gelmini
Change-Id: Ia63ef69c17c99de0c7bc3f33e7fc41dc042c2751 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161925 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2024-01-11tdf#105844 add test for ODF wholesome encryption with macro signatureMichael Stahl
... plus manifest schema extension. Change-Id: I73721db8620e97bd58556f9a71afcb0a33f6c7e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161898 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-03UnoApiTest::loadFromURL -> UnoApiTest::loadFromFileMike Kaganski
The old name was misleading (it doesn't take an URL, but a filename); also, now it's easier to grep for it - doesn't get mixed with vcl::graphic::loadFromURL. Change-Id: Ib88d2194200a6a54d2326971e0306ba39f0c7025 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161578 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-19Extended loplugin:ostr: xmlsecurityStephan Bergmann
Change-Id: I639bf4af888e5af615379515d92ad70025d8ac15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159660 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: xmlsecurityStephan Bergmann
Change-Id: I6cdabef12d60f9fa554b95c99e702e8c700329e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158296 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-08-27Fix typoAndrea Gelmini
Change-Id: I9880e5a7957bf2124f1ce8d9fc0cd3e44e129e65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156154 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-26XMLSecurity Module Documentation UpdateTokieSan
Updated the README Documentation file for xmlsecurity module. Fixed broken sxd file for signatures workflow. Added dumb certificates creator shell script for testing purposes in qa. Change-Id: Ibee17193a1a38348f2e7fc460dfdd0c54dd31f9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155932 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-06-16tdf#146547 sfx2: allow read-only documents to be modifiedMichael Stahl
This is particularly useful for a Writer document that contains a section that is set to be editable in a read-only document, so that the user is warned when closing such a document without saving it. Originally this check was added in commit 27db57efc51487b3976fbf73df1868b8fb78d201 "CWS fwkbugfix05" "#i39869#: readonly docs should never become modified" but the actual problem there was that the read-only document was displayed in a wizard dialog, not in a document view, so let's instead check that the document is some kind of "internal" document. Also the dialog's Save button should do something, and since the document is read-only, a Save As dialog appears appropriate. Change-Id: I339cbe92a2c9eb74a1f5061246f921037a47f79c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153180 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-05-16xmlsecurity: do not run the test with HAVE_FEATURE_PDFIMPORTXisco Fauli
The test is meant to test PDFiumLibrary Change-Id: Ib99d1aef4857df09fa3e73a9cfdf130c7660619d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151761 Tested-by: Jenkins Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-04-17Remove some unused includesMiklos Vajna
Mostly com/sun/star/frame/Desktop.hpp is unused after inheriting from UnoApiTest. Change-Id: I71b75fa5c880337ff294583b96af09c90b5059c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150514 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-01-05Revert all the recent loplugin:unocast changesStephan Bergmann
...as obsoleted by ef533553559fe09b4afab651fc692885d1acf4ed "Rudimentary support for dynamic_cast on UNO proxy objects". This reverts all of: 4cfcc9ac37b90ce64c8402a41eb4638adb185b5c "loplugin:unocast (framework::Desktop)" 03efbf72f4ddf7a84aa8aabef348331bd4b75e8a "loplugin:unocast (vclcanvas::TextLayout)" 80099fdd51a69eaa6c36ca88ef772810e4a777fa "loplugin:unocast (SalGtkXWindow)" cc147f576d8687fb79c77d47d41dc4ba1678a469 "loplugin:unocast (sdext::presenter::CachablePresenterView)" 40db42be1d8fd0f9c6c8c5ba3767ddb9ee2034c2 "loplugin:unocast (vclcanvas::CanvasFont)" 2d1e7995eae29e2826449eb5179f5fae181794a5 "loplugin:unocast (CairoColorSpace)" 4c0bbe4bd97636207cf71a6aa120c67698891da9 "loplugin:unocast (canvas::ParametricPolyPolygon)" 89803666621c07d1b1ac9d3bd883f0ca192a91a0 "loplugin:unocast (vclcanas::CanvasBitmap)" d5e0c2c8db71878d21c2a7255af08cf5f9a6dd04 "loplugin:unocast (sfx2::DigitalSignatures)" c0c4519e0d5b555f59bbc04cc616454edfd1f4ce "loplugin:unocast (VCLXAccessibleComponent)" feb8b833a6245d42400f42a0bc789dc84594ee6f "loplugin:unocast (VCLXDialog)" 1fa58cc6cc9c3849753342a5d9a6ddfa461b5e66 "loplugin:unocast (VCLXMultiPage)" f481f036deb1b1b46f3038074c4659f3a91b9c6c "loplugin:unocast (DocumentSettingsSerializer)" 73df933f5fa5932f94e5a1b338a3eda00a9ce354 "loplugin:unocast (css::embed::EmbeddedUpdate)" 420165ab0ef03c0467f9d17f504de2d2fc78f0e6 "loplugin:unocast (canvas::tools' StandardColorSpace, StandardNoAlphaColorSpace)" 9abe8ee067e6c00f19d8a13346d53c4641c27166 "loplugin:unocast (MutableTreeNode)" 9f3022ceb036f23b4b0994c3e2fbd1001bff225a "loplugin:unocast (VCLXTabPage)" 1be70dda02c12a60778b7607cff2520ae1aa611e "loplugin:unocast (vcl::unotools::VclCanvasBitmap)" d6a70bb641b96e8e5616448c2378131ed62658b4 "loplugin:unocast (basegfx::unotools::UnoPolyPolygon)" 5a14f009e6782c077463c8cbb8e9cea3d7950107 "loplugin:unocast (xmlsecurity::Certificate)" 99009c9535dfa3e0d838989ccc7d84bfa2320ff4 "loplugin:unocast (sd::Annotation)" 0c7585c5fa78887e5459885ed744e8044fd76137 "loplugin:unocast (sd::TextApiObject)" 24e14afd1bfcaed6c200ab081973fba7e47267ca "loplugin:unocast (SignatureVerifierImpl)" 1a7ad0c10d286ce9ae2700ceb2fd50eed1fb43a4 "loplugin:unocast (pcr::PropertyEventTranslation)" a97e2d2702d9a6f37775ccee2c08c4f3b2479c4b "loplugin:unocast (RangePageBreaks)" 19dfdf86ad1f5b08041d8b7a9f196caf881231ab "iloplugin:unocast (pcr::OFormattedNumericControl)" f9785ea595fd8e911f6370e836fa579225b9e571 "loplugin:unocast (frm::OInterfaceContainer)" 5e5f40a4a92a31b0932c690219d002fcf18598cf "loplugin:unocast (ScVbaShapes)" 27b35b2c215b4832d4378ec3a7ecbba926552d06 "loplugin:unocast (ScVbaShapeRange)" cb3108f860065928552a86cf8acc4b3a95718ecf "cid#1517812 Dereference null return value" feba0ddb1521d1142560fe54b7d7696ee910237f "loplugin:unocast (weld::TransportAsXWindow)" 4d6c23216559eb48f9943bb49d6e475a6d64ba15 "loplugin:unocast (oox::ForumlaImExportBase)" 4844c096a8ab6a9a620c410a0949d4499f12a504 "loplugin:unocast (cairocanvas::SurfaceProvider)" 9a0b523e0a84d403b9092176ccec4b3e3efe42d0 "loplugin:unocast (cairocanvas::CanvasBitmap)" 8a5648d8e59b4b007dbbf3824777c19a21efc61e "loplugin:unocast (cairocanvas::TextLayout)" 28c27a0623bc78a0590858f97d03b620985bc84c "loplugin:unocast (cairocanvas::CanvasFont)" 53bc223cb3288e32a417696ee61c29e5f01f209d "loplugin:unocast (cairocanvas::RepaintTarget)" 5f70b0b9f6bc4ab145ddbd9155590ed4a3b1b9ec "loplugin:unocast (SvXMLImport)" 068187a898cdd2e26e9b16c348ecc1ed2dee3f29 "loplugin:unocast (VCLXWindow)" 88b4f966202717cd4ad38a30a8eda22c3e69ed35 "loplugin:unocast (sfx2::sidebar::SidebarController)" f1b7a69b280aefe2f1b3b0f32193494fd765f2bd "loplugin:unocast (SvxLineStyleToolBoxControl)" ba76f0ba7e8de4d2953739c952004b7d9af47197 "loplugin:unocast (i18npool::Calendar_gregorian)" 840154daf934d8df52ead1cb7acd798c4d30f007 "loplugin:unocast (framework::AddonsToolBarWrapper)" b0e9c4c5f063cefa9557810e3349bdb9c7493091 "loplugin:unocast (GrammarCheckingIterator)" 8ee6cfc9655ce9de4617cea1a0d9cb9d7a4fbfac "loplugin:unocast (ucb::ucp::ext::Content)" 5b8cd77c112bc8c0e92b8fec215c3c8e802bbc0a "loplugin:unocast (basic::SfxScriptLibraryContainer)" 9e73ff9fce12e102bb3c3cea8d8bb96c88f2c9ad "loplugin:unocast (sdext::presenter::PresenterNotesView)" a98acca8fbc38d3fd5600ae5056a8e42b6d8a40d "loplugin:unocast (SelectionChangeHandler)" c0b59ad6e35b0cb0dea0821e95f95569739078c1 "Consistently use comphelper::getSomethingImpl<I>(aIdentifier, this)" 276e3ccbdd3259ec3daf8a1a98fa7f406b14e21c "loplugin:unocast (vclcanvas::RepaintTarget)" Change-Id: I37c73e3422a5154bf6cb647640d2d3f23db8bc34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145063 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-22loplugin:unocast (xmlsecurity::Certificate)Stephan Bergmann
(See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: I3d9bd77093d2e6376717d27f105e72ff5a919fe7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144696 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-01CppunitTest_xmlsecurity_signing2: inherit from UnoApiXmlTestXisco Fauli
for some reason, if xmlsecurity/qa/unit/signing/signing2.cxx is executed with CppunitTest_xmlsecurity_signing, it makes testPreserveMacroTemplateSignature10::TestBody to crash, which is weird. Split them in two Change-Id: If43085dac60f197205d70294ec22ddfc86990784 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143527 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-23UnoApiTest: factor out createTempFileXisco Fauli
Change-Id: I8d7bb4593839d3660b6609d836b09d50b68f5712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143141 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-23CppunitTest_xmlsecurity_signing: inherit from UnoApiXmlTestXisco Fauli
Modify testPreserveMacroTemplateSignature10 and testPreserveMacroTemplateSignature12 to test: OTT -> OTT -> OTT OTT -> ODT -> OTT before it was: OTT -> OTT OTT -> ODT -> OTT Change-Id: I1a0b7f1607202e994bf5847660b5abdc715106eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143140 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-09-29split utl::TempFile into fast and named variantsNoel Grandin
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>