Commit Graph
2022 Commits
Author SHA1 Message Date
Noel Grandin 18f2020116 loplugin:constparams
Change-Id: Ic7410f836e584df45101e78e345c8b3c8d355e09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120680
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-18 21:18:29 +02:00
Stephan Bergmann 43542cc07e Missing include
(for std::unique_ptr, with recent libstdc++ 12 trunk)

Change-Id: I61b7823dd740ea7cdfe0d7403a50ac73b24d1c4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120229
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-10 07:39:00 +02:00
Noel Grandin 14cfff500e Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.

Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-05 09:39:11 +02:00
Noel Grandin 05ab38359a Consolidate on C++17 std::scoped_lock instead of std::lock_guard
as in commit 9376f65a26

Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-03 12:20:53 +02:00
Noel Grandin 1597cc5b3e convert #defines to OUStringLiteral
mostly by doing

$ git grep -l '#define.*\"' -- *.cxx
    | xargs perl -pi -e
's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 =
u\2;/g'

Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02 14:43:58 +02:00
Noel Grandin e5982d9148 osl::Mutex->std::mutex in ODigestContext
Change-Id: I168750490f2c60f8c93aef630949acb4e29734b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119750
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-01 13:57:55 +02:00
Noel Grandin 5b5d3d90f3 osl::Mutex->std::mutex in SecurityEnvironment_NssImpl
Change-Id: I4b00afbe71b5459a9b1b8e612e44af71616a9b8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119749
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-01 12:41:02 +02:00
Noel Grandin 6c7d692451 rtl::Static -> static local
in a handful cases, like a map or a vector, we don't need init on demand
at all, the default constructor can be laid out at compile time

Change-Id: I2d404584b5aa23db7b1f779e160e04e72dd2aa74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119656
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-29 14:35:44 +02:00
Caolán McNamara 9a9f8f8f85 cid#1489430 Big parameter passed by value
Change-Id: Ib40bda812872c9421948bc9a1e131ab3f95a0ff0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119557
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-27 17:46:45 +02:00
Caolán McNamara da10cc9909 cid#1489502 Big parameter passed by value
etc

Change-Id: I1242b26fa7e08c1818a0d5d5519e1220fbfb07bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119533
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-27 14:52:21 +02:00
Caolán McNamara 1dd4a80fa0 cid#1489541 Big parameter passed by value
etc

Change-Id: Id7efff454fc73ead0d404495846f7df6e7a16a41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119532
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-26 22:44:51 +02:00
Caolán McNamara 4ce8c219fc cid#1489423 Big parameter passed by value
and

cid#1489424 Big parameter passed by value
cid#1489425 Big parameter passed by value
cid#1489427 Big parameter passed by value
cid#1489432 Big parameter passed by value
cid#1489435 Big parameter passed by value
cid#1489436 Big parameter passed by value
cid#1489439 Big parameter passed by value
cid#1489441 Big parameter passed by value
cid#1489443 Big parameter passed by value
cid#1489445 Big parameter passed by value
cid#1489451 Big parameter passed by value
cid#1489459 Big parameter passed by value
cid#1489462 Big parameter passed by value
cid#1489463 Big parameter passed by value
cid#1489465 Big parameter passed by value
cid#1489467 Big parameter passed by value
cid#1489468 Big parameter passed by value
cid#1489469 Big parameter passed by value
cid#1489473 Big parameter passed by value
cid#1489475 Big parameter passed by value
cid#1489476 Big parameter passed by value
cid#1489477 Big parameter passed by value
cid#1489479 Big parameter passed by value
cid#1489481 Big parameter passed by value
cid#1489489 Big parameter passed by value
cid#1489491 Big parameter passed by value
cid#1489493 Big parameter passed by value
cid#1489495 Big parameter passed by value
cid#1489498 Big parameter passed by value
cid#1489501 Big parameter passed by value
cid#1489504 Big parameter passed by value
cid#1489508 Big parameter passed by value
cid#1489509 Big parameter passed by value
cid#1489513 Big parameter passed by value
cid#1489516 Big parameter passed by value
cid#1489518 Big parameter passed by value
cid#1489521 Big parameter passed by value
cid#1489533 Big parameter passed by value
cid#1489534 Big parameter passed by value
cid#1489537 Big parameter passed by value
cid#1489538 Big parameter passed by value
cid#1489540 Big parameter passed by value

Change-Id: If613144a64087b4e0459f5935e1adbcb0e0330b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119531
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-26 22:44:37 +02:00
Caolán McNamara 7e864acc89 cid#1489419 Big parameter passed by value
and

cid#1489421 Big parameter passed by value
cid#1489426 Big parameter passed by value
cid#1489428 Big parameter passed by value
cid#1489430 Big parameter passed by value
cid#1489433 Big parameter passed by value
cid#1489434 Big parameter passed by value
cid#1489438 Big parameter passed by value
cid#1489442 Big parameter passed by value
cid#1489447 Big parameter passed by value
cid#1489452 Big parameter passed by value
cid#1489455 Big parameter passed by value
cid#1489456 Big parameter passed by value
cid#1489460 Big parameter passed by value
cid#1489461 Big parameter passed by value
cid#1489466 Big parameter passed by value
cid#1489470 Big parameter passed by value
cid#1489471 Big parameter passed by value
cid#1489478 Big parameter passed by value
cid#1489483 Big parameter passed by value
cid#1489488 Big parameter passed by value
cid#1489497 Big parameter passed by value
cid#1489499 Big parameter passed by value
cid#1489500 Big parameter passed by value
cid#1489506 Big parameter passed by value
cid#1489514 Big parameter passed by value
cid#1489515 Big parameter passed by value
cid#1489519 Big parameter passed by value
cid#1489524 Big parameter passed by value
cid#1489528 Big parameter passed by value
cid#1489530 Big parameter passed by value
cid#1489531 Big parameter passed by value
cid#1489536 Big parameter passed by value

Change-Id: I72167511858f16f49b31fd69e39435dbdaf83196
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119530
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-26 22:44:24 +02:00
Noel Grandin 6ed8c5a0f1 use officecfg for security options
Change-Id: I9d91fd5b260b82e05aac6567143386742953ecf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119486
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-26 14:25:35 +02:00
Noel Grandin bebb1a3f2d pass SvXMLNamespaceMap around by value
in SvXMLImport.

Remove an assert in XSecParser because std::move on std::optional
does not make the optional empty, unlike it's effect on std::unique_ptr.

Change-Id: Ie94d01423bf694a37e4bd7f2c0235c5f79a44efe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119302
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-22 10:16:20 +02:00
Stephan Bergmann 9e6a7c043d -Werror,-Wunused-but-set-variable (clang-cl 13 trunk)
...since 362a21d3a1 "Use explicit function names
for fooA/fooW WinAPI; prefer fooW"

Change-Id: I391ae19b01625602231fbd890ee79073367cb449
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117834
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-25 21:12:43 +02:00
Caolán McNamara a8f97e5fca bundle the FolderPicker instantiations behind a single call
in prep to add parent support

Change-Id: I2aa4b9343f895ae866f600dd3260b7fdc4e1efec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117579
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-21 15:29:59 +02:00
Julien Nabet 57796f2724 Simplify Sequences initializations (writerfilter/writerperfect/x*)
Change-Id: I1bd31fe6cf0f8aaf4f2cfe1d3d49e61a0633f361
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117057
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-11 16:03:10 +02:00
Jan-Marek Glogowski b3a56273a3 xmlsec: rename xmlsignaturehelper2 files
Change-Id: I1fe7b2f3e265f05c795689bf4e98e7005ef42cfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116557
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-06-01 22:07:33 +02:00
Caolán McNamara 9940f077fd add Toggleable as a separate thing to a Button
and inherit ToggleButton from both it and Button

Change-Id: If0e500aca8d0ffa087cb5e2bfc1786372fbff4eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115921
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-21 18:19:58 +02:00
Noel Grandin 928ce60435 fix leak in verifyCertificate
Change-Id: I49dd9e0de9b3e44186ed90f00aeb88dad4736374
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115814
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-19 18:17:11 +02:00
Noel Grandin 585948aadf flatten SecurityEnvironment_NssImpl
Change-Id: I89e098c7ff913dfbc2cafbf0cdbabfbbca69110a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115813
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-19 18:16:50 +02:00
Julien Nabet 816c2bb27b Typo: solt=>slot
Change-Id: I742060932f3408bd40921d91e062a7acee0832e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115719
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-18 09:41:52 +02:00
Noel Grandin 870f8bef3c dont leak slot-list in updateSlots
Change-Id: I8882dbd2b5ad7656ec5ff7d47fb2e3dcbcceb5e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115700
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-17 20:52:11 +02:00
Caolán McNamara eb510f2157 gtk4: reenable button
rename label_line_wrap to label_wrap while I'm at it

Change-Id: I3964c4b40d86fb6ef1fd3733088ffd80e57415ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115714
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-17 20:36:25 +02:00
Caolán McNamara 512649f2fb unused include line
Change-Id: I6a41cfa184a653f1b84cf6f33c391ccd531ffc2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115494
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-12 20:46:31 +02:00
Jan-Marek Glogowski 013ddc4f53 Switch OPENSSL config var from negative to positive
- align with most of the rest of config_host
- rename DISABLE_OPENSSL to ENABLE_OPENSSL
- make this configurable

Change-Id: Ic3b41fcdda38db66134939f12265e0da24833d60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114564
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-05-05 21:14:30 +02:00
Noel Grandin c5a0b7af84 loplugin:stringadd improvement for appending numbers
I was wrong, the Concat framework already optimised appending
numbers by stack-allocating small buffers, so include
them in the plugin

Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-03 15:32:53 +02:00
Noel Grandin 39c3574b79 use string_view in INetURLObject::encode
Change-Id: Ib686c6872388b02c8939d3b65f6bd25cda348bc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114754
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-28 15:41:02 +02:00
Noel Grandin c7c6f0af6c loplugin:stringadd convert chained append to +
which can use the more efficient *StringConcat

Also fix a crash in stringview plugin which
started happening while I working on this.

Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27 14:07:56 +02:00
Noel Grandin 75997f13ee no need to create temporaries when appending number to O[U]StringBuffer
Change-Id: I36d82423b5f75010552696a66cec7e53ee265ce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114395
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-22 21:42:14 +02:00
Ahmet Hakan Çelik 3485954401 tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor
Change-Id: Ie7507e6beb470708bb4e52a7b926433043b80d85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112133
Tested-by: Jenkins
Reviewed-by: John Turpish <jbt@gmx.us>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-14 11:07:06 +02:00
Gabor Kelemen 2633d5f97f Recheck include/ with IWYU
See tdf#42949 for motivation

Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-09 11:56:36 +02:00
Noel Grandin 07fd90cc7d rtl::Static -> function local static
Change-Id: I2071c27bdf074403ec24e67f9278ac27f9491303
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113698
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-07 08:08:44 +02:00
Caolán McNamara 36e8a0348f cid#1475790 Uninitialized scalar field
this appeared in:

commit 0dac6d1f17
Author: Miklos Vajna <vmiklos@collabora.co.uk>
Date:   Mon Jan 25 15:34:38 2016 +0100

    xmlsecurity: implement OOXML stream references

and disappeared in:

commit cc1d19f7bb
Author: Michael Stahl <michael.stahl@allotropia.de>
Date:   Tue Mar 30 17:37:31 2021 +0200

    xmlsecurity: replace OOXMLSecParser implementation

Change-Id: Ibaff786612d0f58639471d409dc49d813fb1cb6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113442
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-01 12:34:14 +02:00
Michael Stahl cc1d19f7bb xmlsecurity: replace OOXMLSecParser implementation
This is similar to 12b15be8f4 and following
commits, but OOXMLSecParser has some differences to XSecParser, such as
using a ds:Manifest, and requires a couple extra namespaces.

Change-Id: I56e39d9609db8fcad50ca1632ff482c1f0a30ff5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113381
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-31 09:03:30 +02:00
Mike Kaganski ed9ff1a397 Drop these defines
Change-Id: I7ff56d6f016ea90c4b5cdcbbb36141627037c0ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113125
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-26 15:05:44 +01:00
Mike Kaganski a0656ec6fc const OUString -> const OUStringLiteral
Mostly automated rewrite

Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-25 10:06:26 +01:00
Vincent LE GARREC aef40e7388 tdf#124176 Use pragma once in x*
xmlhelp, xmloff, xmlsecurity

Change-Id: I80c6fa806387f3dcba8be7f93fe2fef146b033e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112050
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-23 13:14:42 +01:00
Mani Kumar bd43c754d3 tdf#88205: Use initializer_list ctor in css::uno::Sequence
Change-Id: I95aaefa11c733f5c020600cf13510af1bc9c0de7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112652
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-18 07:29:56 +01:00
Andrea Gelmini 5a086e43ef Fix typos
Change-Id: I03d48712252cb9f2a3e3c14d6800081ed6af84d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111911
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-03-15 15:15:44 +01:00
Caolán McNamara c0ec7d342b do same set error state as ReadAndVerifySignature does
this function is nearly exactly the same as ReadAndVerifySignature
except it doesn't set error-state on exception during parse

Change-Id: Ife881f639a11d3185920ca62cc2cd22812fae36d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112366
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-12 15:29:47 +01:00
Caolán McNamara b344ecfa6d do same logging as ReadAndVerifySignature does
Change-Id: I89c0e29f595049096afa73ff86badc06c0b40d7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112365
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-12 10:09:21 +01:00
Miklos Vajna 2c2a03340f Drop some unused includes
Change-Id: Ic79d81387867f028eb8dc9553fb87f5961d6c771
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112364
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-12 09:06:20 +01:00
Stephan Bergmann 4af56d8189 Don't use std::ostream operator <<(char16_t const *) deleted in C++20
Building with --with-latest-c++:

> C:/lo/core/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx(664): error C2280: 'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const char16_t *)': attempting to reference a deleted function
> C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\Include\ostream(951): note: see declaration of 'std::operator <<'

etc.

Change-Id: I70ae201c761fae907e602b6a929e23e3c8e7f692
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112318
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-03-11 21:33:25 +01:00
Miklos Vajna 2d30c903af xmlsecurity: rework to avoid pdfium ifdefs in pdfsignaturehelper
Return early in case pdfium is not available, to avoid the ifdef forest.

Change-Id: I1fd1b22015e10527a989c8a1c4f4073fef29553e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112238
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-10 09:05:19 +01:00
Stephan Bergmann bbcf235753 loplugin:refcounting (clang-cl)
Change-Id: I91189ebd902b70e2fbe42fe8cc09b8677af1a5fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112194
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-03-09 14:23:45 +01:00
Michael Stahl ca98e505cd xmlsecurity: fix crash in DocumentDigitalSignatures::isAuthorTrusted()
If the argument is null.

This function also should use EqualDistinguishedNames().

Change-Id: I4068aa94f9d9c422c96b394c82d3e28303774b0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111667
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-03 12:47:50 +01:00
Michael Stahl 90b725675c xmlsecurity: avoid exception in DigitalSignaturesDialog::getCertificate()
Fallback to PGP if there's no X509 signing certificate because
CheckX509Data() failed prevents the dialog from popping up.

To avoid confusing the user in this situation, the dialog should
show no certificate, which is already the case.

Change-Id: I7f382165657f50723ac65a60309567e5b6c5ae1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111664
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-03 12:47:30 +01:00
Michael Stahl 5af5ea893b xmlsecurity: improve handling of multiple certificates per X509Data
It turns out that an X509Data element can contain an arbitrary number of
each of its child elements.

How exactly certificates of an issuer chain may or should be distributed
across multiple X509Data elements isn't terribly obvious.

One thing that is clear is that any element that refers to or contains
one particular certificate has to be a child of the same X509Data
element, although in no particular order, so try to match the 2 such
elements that the parser supports in XSecController::setX509Data().

Presumably the only way it makes sense to have multiple signing
certificates is if they all contain the same key but are signed by
different CAs. This case isn't handled currently; CheckX509Data() will
complain there's not a single chain and validation of the certificates
will fail.

Change-Id: I9633a980b0c18d58dfce24fc59396a833498a77d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111500
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-03 12:47:04 +01:00