Commit Graph
2166 Commits
Author SHA1 Message Date
Andrea Gelmini 12e2826788 Fix typo
Change-Id: I3e20fda4b841458e979258dd5dc83c7f89f48083
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165497
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-03-28 22:01:16 +01:00
Stephan Bergmann bddb0d87e8 Missing include
...presumably since 50897e3fe0 "Drop transitional
header xmlsecurity/xmlsec-wrapper.h",

> xmlsecurity/source/xmlsec/xmlsec_init.cxx:29:9: error: use of undeclared identifier 'xmlSecInit'
>    29 |     if( xmlSecInit() < 0 ) {
>       |         ^
> xmlsecurity/source/xmlsec/xmlsec_init.cxx:55:9: error: use of undeclared identifier 'xmlSecShutdown'
>    55 |         xmlSecShutdown() ;
>       |         ^

etc.

Change-Id: I1aab4bb3601102c4ac0025833b03fa35adc9434e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165465
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-03-28 20:46:43 +01:00
Gabor Kelemen 50897e3fe0 Drop transitional header xmlsecurity/xmlsec-wrapper.h
It was introduced with
commit ec52e5e5a2
and the reason of that was the XMLSEC_NO_SIZE_T behavior consolidation.

But this was removed later with
commit bfd479abf0

Change-Id: Ib5350d9ab5554d1412821b762cd3ee7906b65b64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165440
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-28 12:51:00 +01:00
Rafał Dobrakowski 03b00e03c2 tdf#146619 Remove unused #includes from C/C++ files
'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-03-28 12:50:41 +01:00
Patrick Luby 6a049e417b tdf#160184 ask user if they want to trust an untrusted certificate
gpgme contexts uses the "auto" trust model by default which only
allows encrypting with keys that have their trust level set to
"Ultimate". The gpg command, however, gives the user the option
to encrypt with a certificate that has a lower trust level so
emulate that bahavior by asking the user if they want to trust
the certificate for just this operation only.

Also, abort saving if no certificates are selected which is an
indication that the user cancelled the Select Certificate dialog.

Change-Id: I20951b1e31b2dcf8adb82243742f8c00fbaca8c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165260
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-26 10:01:31 +01:00
Rafael Lima 6178387f7b tdf#159985 Warn about the need to reload file after changing macro security level
Change-Id: I191fd5d676d6d54fb0ef15652420afdceab2fc78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164810
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-03-19 14:48:34 +01:00
Gabor Kelemen f35ff76607 Remove SaveODFItem class
This is effectively unused since:
commit d22ab7b444

Change-Id: I6f646b7daf845035196fc9dde4ff270b8143d37a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164645
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-12 18:49:26 +01:00
Patrick Luby ce8d6b6836 Related: tdf#152524 eliminate UserData struct name collision
The cui module has its own UserData struct and when building with
--enable-mergelibs=more, this data collision will cause a crash
when deleting a UserData instance in the xmlsecurity module because
the cui module already has its own, unrelated UserData struct.

Change-Id: I6418b049c72a2e902c9b5076b72fd240f65a593d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164404
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-05 18:35:14 +01:00
Mike Kaganski 3502484d53 Use SAL_WNODEPRECATED_DECLARATIONS_(PUSH|POP)
Change-Id: I2810d22e8f5e1c81647b9e9b15519de65939630a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163895
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-25 05:20:41 +01:00
seturaj b508e4f081 tdf#42982: Improve UNO error reporting. Make exceptions more descriptive
Change-Id: Idb292c508029efeb23ed969c9fad566154cb424c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162354
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-02-16 10:52:16 +01:00
Patrick Luby efe414c4a8 Don't reuse CertificateChooser instances
Reusing the same instance will, in the following case, lead to a
crash. It appears that the CertificateChooser is getting disposed
somewhere as mpDialogImpl in its base class ends up being null:

1. Create an empty Writer document and add a digital signature
   in the Digital Signatures dialog
2. File > Save As the document, check the "Encrypt with GPG key"
   checkbox, press Encrypt, and crash in Dialog::ImplStartExecute()

Change-Id: I9aaa1bd449622e018b502d68c53d397255a1b61a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163065
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-02-07 14:40:50 +01:00
Caolán McNamara cf4514d4e7 Resolves: tdf#156352 disable sorting while adding rows
looks like the new row gets sorted immediately when added as an empty
row into the first row, so accessing it by index later to set it text/id
get an unexpected result.

pause sorting while inserting the entries and enable it again when
finished for the easiest fix.

Change-Id: Ib028b193afbf2b9026841b19419e012b70448e39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162993
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-05 13:41:00 +01:00
Patrick Luby 538f7b45c0 tdf#147291 add more default certificate manager application for macOS
Add the following applications to the macOS GUI servers list:

- Trusted Key Manager - CertEurope
- SCInterface Manager and SmartCard tools

Change-Id: Iec78171c6e82f0a072f5f06b79606560a8cc03cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162942
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-05 09:03:56 +01:00
Patrick Luby 29bf86f7cb tdf#159307 add default macOS certificate manager applications
Most, if not all, of the Linux certificate manager applications are
not available on macOS so create a separate list for macOS.

Also, fix uncloseable windows due to uncaught exceptions thrown by
XSystemShellExecute::execute(). Failure to catch such exceptions
would cause the document window to be uncloseable and the application
to be unquittable.

Change-Id: I9bc6dc9c6c9d054252b634874045cb066023214a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162887
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-02 07:55:01 +01:00
Michael Stahl b85c2459ce check that rtl_random_getBytes() was successful
... everywhere it is used to generate material for encryption.

Change-Id: Id3390376bb2f3a5fa1bbfd735850fce886ef7db2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162873
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-02-01 13:54:32 +01:00
Stephan Bergmann 32ef7cea77 tdf#159307 Fix GetCertificateManager
...which had always cut off an existing path ever since
92b6ffcd9f "Allow selecting a custom certificate
manager", for reasons that are unclear to me.

So if an existing setting contains at least one slash (or backslash, on
Windows), try to use it as-is; otherwise, keep searching for it in aPath.  (And,
in any case, make sure to report back the given value in sExecutable.)

Change-Id: I8b2b6ac7a449d7afd02e029ff46d4c79e6b824e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162703
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-30 07:38:28 +01:00
Mike Kaganski 0fa827dbb2 Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27 12:43:48 +01:00
Michael Stahl 3e9a700091 tdf#105844 xmlsecurity: fix test failure on WNT
Commit 4d6e9d5e15 added 2 tests that
always fail on WNT, unfortunately Jenkins doesn't actually run the
tests.

There are 3 certificates involved:
"Xmlsecurity RSA Test Root CA"
"Xmlsecurity Intermediate Root CA"
"Xmlsecurity RSA Test example Alice"

In the signature XML, there are 3 elements that contain or reference
certificates:

1. X509Data - xmlsecurity produces only the signing certificate here
2. xd:SigningCertificate (XAdES) - again only the signing certificate
3. xd:EncapsulatedX509Certificate (XAdES) - xmlsecurity produces the
   full certificate chain here

All of these elements *could* contain the full certificate chain, but in
LO-produced XML signatures only 3. does.

The problem is that the function CheckUnitTestStore() that looks up
a certificate in a unit-test-specific CA store via
$LIBO_TEST_CRYPTOAPI_PKCS7 can only handle a root certificate, it does
not recursively retrieve and check a certificate chain.

The SecurityEnvironment_MSCryptImpl::verifyCertificate() already has a
parameter "seqCerts" to pass in the full certificate chain, but due to
the way the data from the XML is processed, it gets passed only the
content of the X509Data element(s), which, for LO-produced signatures,
do not contain the full certificate chain.

Instead of improving the unit-test-specific function, let's try to get
all the certificates out of the XML signature, and then pass them to
verifyCertificate().

Of course this requires some consistency checks so that the verification
can't be fooled by different certificates in different XML elements.

Change-Id: I8ca541887ceac2dfb6af5d96a5565cfa58d7f682
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162170
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-16 19:10:57 +01:00
Noel Grandin f54d9547c0 loplugin:unusedmethods
Change-Id: I24c429c7cb8283a384b72499d1c3f4c2f1457c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162155
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-16 13:01:25 +01:00
Caolán McNamara 6875c975f8 upgrade libxml2, libxslt & liblangtag
what I'm really after is some vexating not-reproducible oss-fuzz msan
warnings when using libxml2 in the fodt2pdf fuzzer. So lets upgrade
libxml2 to the latest, which requires bumping libxslt, and then requires
a newer liblangtag because of no longer implicit includes that it
depended on.

xmlKeepBlanksDefaultValue and xmlSubstituteEntitiesDefault are
deprecated, we should get around to updating those uses

Change-Id: I8fda0dffda0a7ea65407d246a3121875cb8ad4a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161598
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-05 11:05:36 +01:00
Julien Nabet df2586cd98 Replace "size() != 0 with !empty()" (xmlsecurity)
Change-Id: Ibc1b8265292f579760c08c2906687118a8cf6df4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161491
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-31 16:27:31 +01:00
Noel Grandin d2fd70c655 no need to use SvLockBytes in UriBindingHelper
we already have other, simpler facilities for wrapping streams

Change-Id: Icff4cca2d6327dad9c5964ca61d578506009d047
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-30 19:05:49 +01:00
Thorsten Behrens 4a532e651b xmlsecurity: fix AES-GCM code differently
With PCH, the earlier workaround with NSS_PKCS11_2_0_COMPAT breaks -
so lets fix this with conditionals, its only two places.

Follow-up commit to 9276d5338e

Change-Id: I7d3292304d83d784ee9dce5cdc62b4a028ff333a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161204
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-12-24 00:29:34 +01:00
Michael Stahl 9276d5338e xmlsecurity: fix AES-GCM code to build with NSS < 3.52
(regression from commit f0fda7ad22)

Change-Id: I42fda00eb37fb1939013b21158c931d47e4e8486
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161117
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-21 13:12:26 +01:00
Michael Stahl 4eebf31e38 xmlsecurity: remove "AdES-compliant signature" checkbox
This is essentially a footgun because the user can accidentally turn it
off and get non-AdES signatures which use obsolete SHA1 hashes.

Unfortunately it turns out that the initial setting of the checkbox only
works for ODF, because OOXML have m_sODFVersion set to "1.0" due to some
defaulting code somewhere.

So what this checkbox actually did is unintentionally disable XAdES
signatures for OOXML by default.

Now that i actually test it by setting ODF version 1.1 in
Tools->Options, it turns out that signing ODF 1.1 documents isn't
possible at all, a dialog pops up that says "Signing documents
requires ODF 1.2 (OpenOffice.org 3.x)".

Change-Id: I0eaf590c290b2c0ee0ff890ed73f0dbea4cf0ce3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160785
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-15 10:52:04 +01:00
Michael Stahl 53c64cce13 xmlsecurity: fix assert in CertificateChooser::ImplInitialize()
gtk3/gtkinst.cxx:15371: virtual void (anonymous namespace)::GtkInstanceTreeView::select(int): Assertion `gtk_tree_view_get_model(m_pTreeView) && "don't select when frozen, select after thaw. Note selection doesn't survive a freeze"' failed.

(regression from commit ad6f23d2a3)

Change-Id: I8c0639e755188731bdd211f9d71a830d7afeeaa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160786
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-15 10:51:22 +01:00
Michael Stahl f0fda7ad22 tdf#105844 offapi,package,sfx2,xmlsecurity: add AEAD w/ AES GCM
... and use it in the new experimental ODF encryption mode.

https://www.w3.org/TR/xmlenc-core1/#sec-AES-GCM

Unfortunately it turned out that NSS PK11_CipherOp() does not work with
CKM_AES_GCM because it is initialized with "context->multi = PR_FALSE"
in sftk_CryptInit(), so the one-step functions PK11_Encrypt() and
PK11_Decrypt() have to be used.

NSS 3.52 also changed a parameter struct definition - see
https://fedoraproject.org/wiki/Changes/NssGCMParams - which is not a
problem for RHEL or SUSE system NSS since those are rebased, but it
is likely a problem for less well maintained Ubuntu LTS, so use
the old struct definition which evidently still works with NSS 3.94.

NSS 3.52 also added a new PK11_AEADOp() API but it looks like this
doesn't support incremental encryption either.

Change-Id: Ibd4a672db74b65b1218926ba35ff8d2f70444c7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160505
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-11 20:46:40 +01:00
Michael Stahl 2f12d5bb9c xmlsecurity: deploy asserts in OCipherContext
Missed a special case in previous commit, in case the input is
completely empty and PK11_DigestFinal() doesn't see a problem with it,
aResult could be empty too.

Change-Id: I8ea900774ae390857307ec5bab38876bead6bc86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160441
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-08 09:31:42 +01:00
Michael Stahl 328b135f0d xmlsecurity: check for errors in OCipherContext::Create()
If this function returns null, storing a document will proceed without
reporting an error to the user, and lose all the data.

Change-Id: I0f9fd53702321e7997b28e12eb5bed3349bbcc13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160435
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-07 21:46:00 +01:00
Michael Stahl c218b7eab5 xmlsecurity: W3C padding max size is the block size
Change-Id: I90c48aafd11deb2895d01c90764fc433a9161e07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160434
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-07 18:01:49 +01:00
Michael Stahl f6536f4db6 some cosmetic improvements, better warnings
Change-Id: I05a7eeb74088c278aab94519c7f53b0482e38058
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160400
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-07 09:28:08 +01:00
Julien Nabet a761272a68 c++20: use std::erase(_if) instead of std::remove(_if)+erase (xmlsecurity)
Change-Id: Ia7d9b806667a7c11743f7e9e4bb5525a1202e7fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159712
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-20 07:41:08 +01:00
Noel Grandin 74f884d48e new loplugin:fieldcast
new plugin to look for class fields that are always cast to some
subtype, which indicates that they should probably just be declared to
be that subtype.

Perform one of the suggested improvements in xmlsecurity/

Change-Id: Ia68df422c37f05cbcf9c02ba5d0853f8eca4f120
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159063
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08 06:50:24 +01:00
Stephan Bergmann bd6fb0cd3e Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...in include files.  This is a mix of automatic rewriting in include files and
manual fixups (mostly addressing loplugin:redundantfcast) in source files that
include those.

Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-23 11:04:42 +02:00
Stephan Bergmann 0c07a65377 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: xmlsecurity
Change-Id: I6cdabef12d60f9fa554b95c99e702e8c700329e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158296
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20 22:48:04 +02:00
Arnaud VERSINI 0c4913e03e xmlsecurity : simplify DigitalSignature
Change-Id: I05777731f1d69b5714942411401afb5fd605d726
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155668
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-19 11:29:49 +02:00
TokieSan fb9874231f Caching Certificates in the CertificateChooser dialog session-wise
Added the functionality of caching certificates per session using a
single instance with internal memoization. Added Reload Certificates
button in case of certificate changes in-session. Updated all instances
of certifcate chooser in the codebase to work with the new change.

Change-Id: Icb25a2b2e9787b029fa6189f70bd4ba3b6806f60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155373
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-08-26 00:59:48 +02:00
TokieSan 9f327102c4 Removed Type and Usage Columns from Certificate Chooser
Both columns are irrelevant in the main dialog's view, can be viewed
through viewing certificate's details.

Change-Id: I265a7e125c2679f3a05dba4414f4104f3a5cac2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155746
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-08-23 08:42:27 +02:00
Arnaud VERSINI 127a55391c xmlsecurity : simplify DigitalSignaturesDialog
Change-Id: I460d56a5a13dde1bd77f21e0bb6467dd00cb3f40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154498
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2023-08-07 11:28:40 +02:00
Noel Grandin a66b9c9adf loplugin:unusedfields
Change-Id: Ic2e9de67a00bb9ca8ab4d0f7528b22c58d0cc360
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154721
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-21 22:16:34 +02:00
TokieSan ad6f23d2a3 Added searching and filtering features to certificate chooser dialog
Added a new search box in the certificate chooser dialog, introduced
local caching for certificates to allow instantaneous filtering and
searching. Modified viewing signatures function to allow searching
functionality.

Change-Id: I361a47da7bd5d24efcbfc17065935851db951c44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154630
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-07-20 13:05:14 +02:00
Arnaud VERSINI d22ab7b444 xmlsecurity : simplify DigitalSignaturesDialog::canAddRemove.
(!a && b) || (a && b) => b

Change-Id: Iee9ae38d9dc5f6aa94eaff61b3937633f5da7af1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154285
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2023-07-17 10:58:27 +02:00
Miklos Vajna a0471ec6e9 xmlsecurity: fix deadlock on preloading libsdlo.so
The trouble is that calling into the configmgr would require recursive
access to the service manager, but that's protected by a non-recursive
mutex.

See
<https://gerrit.libreoffice.org/c/core/+/153798/24#message-b04c747da2cb73230d88ec65cc8207ac8b124dda>
for details.

Change-Id: If75779a995c2ad8855073bd6538832a18953d4cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154356
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-07-12 15:41:26 +02:00
TokieSan 92b6ffcd9f Allow selecting a custom certificate manager
Added a new option in Tools>Options>Security that allows choosing the
path of a different certificate manager.

Made Certificate Manager Button be disabled instead of hidden in case no
certificate manager is detected. Added a box notifying that the
certificate manager is opened (or not working in case it failed for some
reason).

Change-Id: I64a901766d4fb05c59c0f85fdf94c08a3ca4bdab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153798
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-07-11 16:30:59 +02:00
Arnaud VERSINI f57bb8bbad xmlsecurity : remove deadcode and usage of array template
Change-Id: I282e2af395471aa4818bfb4586ac06c7850c8a61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153862
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Tested-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2023-07-07 07:59:51 +02:00
Noel Grandin 0193b284e8 new loplugin:constexprliteral
OUStringLiteral should be declared constexpr, to enforce
that it is initialised at compile-time and not runtime.

This seems to make a different at least on Visual Studio

Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-26 13:12:31 +02:00
Arnaud VERSINI 66e25cfe4f xmlsecurity : remove unneccessary static variables
Change-Id: Ie7ecba234f33cc09ebd4cf5a390919acb4bc7e08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153567
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-26 07:56:01 +02:00
TokieSan 17ba20e132 Certificate Manager button is hidden in case no manager exists.
A new function is implemented to check for that in
digitalsignaturesdialog.cxx

Change-Id: I4cf1c710e6a145e8f0d10716cb81394bdcf7a74f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153367
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-06-24 18:19:18 +02:00
TokieSan 46722dbaa7 tdf#155665 Adding option to remember signatures for each save
Added the option in digital signatures dialog to remember used
signature.

Implemented ResignDocument function in objserv.cxx to resign after
every save in case the option to remember signature is on.
Added a new dialog box that checks whether there is a need to
remember the signature.

Change-Id: Ia7dbcc952044e9542e3fe6cd84b5d6633fcd1461
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152687
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-06-18 22:03:43 +02:00
Gabor Kelemen 75ed566894 Add script to find unused using declarations
As a complementer to clang-tidy-12 --checks="-*,misc-unused-using-decls"
Pros:
- simple, fast!
- finds some more unused declarations, somehow
- works on non-linux specific parts of the code
- clang-tidy (for me) trips on files with external headers, this does not

Change-Id: If2db989114ac5c2841ed2e89ff7bd7a9e419f567
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150612
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-04-25 08:09:28 +02:00