summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)AuthorFilesLines
2019-11-05make some classes module-privateNoel Grandin5-5/+5
Change-Id: Ice9a57eedb166672dbdfae6da2a172ab77566a19 Reviewed-on: https://gerrit.libreoffice.org/81983 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03loplugin:stringaddNoel Grandin1-3/+1
tweak the plugin to be more permissive, then validate by hand afterwards Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654 Reviewed-on: https://gerrit.libreoffice.org/81942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03find symbols that can be privateNoel Grandin2-8/+8
update the script and make private standalone functions Change-Id: Icb26ce258107700c90f89ad4e0d3329d075a2eb1 Reviewed-on: https://gerrit.libreoffice.org/81879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-31Fix StringAdd::isCompileTimeConstantStephan Bergmann1-4/+2
...to find StringLiteral on the RHS of +=. Which revealed that the VisitCompoundStmt/checkForCompoundAssign logic needed to be fixed, too, so that s += side_effect(); s += "literal"; s += side_effect(); only gets combined to s += side_effect() + "literal"; s += side_effect(); and not all the way to s += side_effect() + "literal" + side_effect(); Change-Id: I432e3458b933a7d0ad6141c747b675cc8b0f0ba4 Reviewed-on: https://gerrit.libreoffice.org/81804 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák2-4/+25
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-17Remove some memset callsMike Kaganski1-2/+1
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-16tdf#42316 handle saving to template filtersJan-Marek Glogowski1-18/+163
This extends the filter comparison from commit c3a1c83ff5af ("tdf#42316 preserve macro signature of templates"). The original patch just stripped "_template" from the source filter to find equal document types, which just enables the "template => document" case. This patch also strips the "_template" from the target filter, which fixes the "document or template => template" cases. This also extends the signing save tests: * OTT 1.2 => OTT 1.2 - preserve * ODT 1.2 => OTT 1.2 - preserve * OTT 1.0 => OTT 1.0 - preserve * ODT 1.0 => OTT 1.0 - preserve * OTT 1.0 => OTT 1.2 - drop Change-Id: Ie297258a4d9f9aa4beb25786c6ba240b6f16f49b Reviewed-on: https://gerrit.libreoffice.org/80654 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin1-1/+1
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-10Silence -Werror,-Wunused-variable (clang-cl)Stephan Bergmann1-1/+1
Required a workaround for loplugin:indentation, until <https://reviews.llvm.org/D68581> "Include leading attributes in DeclStmt's SourceRange" lands in Clang. Change-Id: I7192969d40fa4c50bbd603d059532b9344865248 Reviewed-on: https://gerrit.libreoffice.org/80596 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-09tdf#114441 changed some sal_uLong to better fitting typesChristian Barth1-1/+1
Change-Id: I114a6b028eb59a1ae38c31bc20439a35643fe972 Reviewed-on: https://gerrit.libreoffice.org/80159 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-10-08loplugin:redundantpointerops simplify *p.get()Noel Grandin1-1/+1
Change-Id: I12517651fb3f777fd08e384992bb3e84b340ad85 Reviewed-on: https://gerrit.libreoffice.org/80382 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-06Related: tdf#127935 set default activate handler to toggle row expansionCaolán McNamara4-4/+6
Change-Id: I2bbfb1445b8d2e748f642cdf4723d41b7f072e2b Reviewed-on: https://gerrit.libreoffice.org/80305 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-01loplugin:stringconstant (clang-cl)Stephan Bergmann5-6/+6
Change-Id: Id1a82cea4444255fdb693e126b7571a406094624 Reviewed-on: https://gerrit.libreoffice.org/79916 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01add activates_default to GtkEntries in dialogsCaolán McNamara1-5/+7
activates-default of True means pressing return activates the default button of the action area, which is typically what vcl Edit did by default. Change-Id: I60bc1634b04a486af86526d887d0ada961b08076 Reviewed-on: https://gerrit.libreoffice.org/79860 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-28loplugin:constmethod in xmlsecurityNoel Grandin8-15/+15
Change-Id: I7892b4819fd7491882e6ca995bf2ce5c65230609 Reviewed-on: https://gerrit.libreoffice.org/79791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26Remove some unused includesMiklos Vajna1-1/+0
Change-Id: Ic28b4bdd401342d92b33913f7dab0ca875f8aab3 Reviewed-on: https://gerrit.libreoffice.org/79573 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák2-2/+2
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-10Fix typosAndrea Gelmini1-1/+1
Change-Id: Id62178a1a8b2e05d13c47f1ac4798578f140dbae Reviewed-on: https://gerrit.libreoffice.org/78794 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-09-06tdf#39593 use isUnoTunnelIdArkadiy Illarionov5-16/+11
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-06Fixing '....' and '..'Andrea Gelmini2-2/+2
Change-Id: I926069d6c1f2712e5020d930f7ff6c62fd00e912 Reviewed-on: https://gerrit.libreoffice.org/78667 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-23tdf#39593 extract UnoTunnelId comparison to template functionArkadiy Illarionov4-4/+4
Change-Id: Ia2b5dea273c8de7b8c54e74780193a8d4cba7b45 Reviewed-on: https://gerrit.libreoffice.org/73874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-21loplugin:constvars, look for loop vars that can be constNoel Grandin1-1/+1
Change-Id: I67ee714739800f3718f9d3facf57474cd564d855 Reviewed-on: https://gerrit.libreoffice.org/77415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20tdf#116862 do not encrypt to self when encryption key is not setFranklin Weng1-7/+9
When "always encrypt to self" is checked but no encryption key is set, encrypting a file with GPG key would cause error. So check if msPreferredKey is empty or not before comparing with sIssuer. Change-Id: I4d95f0b436cb1fafad1d57d50330fd2080902b69 Reviewed-on: https://gerrit.libreoffice.org/77665 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2019-08-16use more TOOLS_WARN_EXCEPTIONNoel Grandin1-2/+1
Change-Id: Ic21ea11ff106e0732bb8fa600ef39a549d7bda86 Reviewed-on: https://gerrit.libreoffice.org/77569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16new loplugin:sequenceloopNoel Grandin7-9/+10
look for places we should be using std::as_const on for-range loops over uno::Sequence, to avoid triggering a copy Change-Id: I7efb641bf09d37c87946f03428ee4eec90298c8a Reviewed-on: https://gerrit.libreoffice.org/77441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-14Simplify OUString array initializationMike Kaganski1-10/+11
Change-Id: I54945ed1ea2292ecc02ff988c4ecf310a9c4b87a Reviewed-on: https://gerrit.libreoffice.org/77451 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-14Don't hardcode "C:\\Program Files (x86)" path on WindowsMike Kaganski2-2/+23
It might be simple "Program Files" on 32-bit system; or localized (see https://www.samlogic.net/articles/program-files-folder-different-languages.htm), or on a different drive (if system isn't on C:), etc. Change-Id: Id0f28b4c4920fcda53a58fbff9f42bcfde6668f6 Reviewed-on: https://gerrit.libreoffice.org/77448 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-13tdf#116085 add more Gpg4Win binary locationsThorsten Behrens1-3/+8
Seems Gpg4Win recently grew a few more variants where to put stuff. Look there, too. Change-Id: Ifa09db11665671f518a6a66480c1a71fd619d8cd Reviewed-on: https://gerrit.libreoffice.org/77341 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-08-10assertDocument is only defined for HAVE_FEATURE_GPGVERIFYStephan Bergmann1-0/+2
Change-Id: I2dbe5da48d1114703481fffcc310f775308df007 Reviewed-on: https://gerrit.libreoffice.org/77236 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-06tdf#42316 preserve macro signature of templatesJan-Marek Glogowski4-1/+248
When comparing the filter of the current and the target document we have to strip the '_template' from the filter name. Still this won't preserve the signature of the document attached to tdf#42316, as this is a ODF 1.0 OTT, which doesn't have a valid signature in ODF 1.2, as the signature doesn't match the ODF 1.2 namespace for signatures and the default LO ODF version is ODF 1.2 extended. In theory the signature itself could even be converted most times, but that can be done in an additional patch, if needed. Since the code literally saves a template to an internal document, SfxObjectShell::DoSaveCompleted must keep the signature of the template. Eventually it'll be dropped on save of the template as a document later. The signing tests check "OTT 1.0 => ODT 1.0: preserve", "OTT 1.2 => ODT 1.2: preserve" and "OTT 1.0 => ODT 1.2: drop". Change-Id: I2263093687f5a0568ea781ce3ac9b114c9599add Reviewed-on: https://gerrit.libreoffice.org/75958 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-07-31Fix typosAndrea Gelmini31-34/+34
Change-Id: I69e5c6d82fddd1da1e414e7764f3a5d90351a43d Reviewed-on: https://gerrit.libreoffice.org/76377 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): xmlsecurityStephan Bergmann20-31/+31
Change-Id: I47c93247b9a34abf4b95966833664e63eb57f133 Reviewed-on: https://gerrit.libreoffice.org/76621 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-25Fix typosAndrea Gelmini1-1/+1
Change-Id: I59a0fd175fa5185c15d093d2d9bed9f95bb4cfd5 Reviewed-on: https://gerrit.libreoffice.org/76280 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-24Fix typosAndrea Gelmini9-21/+21
Change-Id: Ib778a6598f3797fe871a25b56b7b4b7761889296 Reviewed-on: https://gerrit.libreoffice.org/76269 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-21loplugin:referencecasting in xmlsecurityNoel Grandin6-42/+23
Change-Id: Ic3daba9e6e94516ea4d80f25f73e9e46a50edb5c Reviewed-on: https://gerrit.libreoffice.org/76035 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-16cid#1448421 unsafe_xml_parse_configCaolán McNamara1-1/+1
do we need this as 1 ? Change-Id: I12cdec90f5ca989767a769dfc1dbebf73fae696c Reviewed-on: https://gerrit.libreoffice.org/75658 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-07-16cid#1448248 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: I3b50d3affeb0c25a12dcb2ae0d5c2216d5419249 Reviewed-on: https://gerrit.libreoffice.org/75659 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-06-18loplugin:passstuffbyrefNoel Grandin1-1/+1
Change-Id: Icb7c22cf4ac95eab54d04e79312fb471ca27bceb Reviewed-on: https://gerrit.libreoffice.org/74246 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-18loplugin:logexceptionnicely in xmlhelp..xmlsecurityNoel Grandin3-10/+13
Change-Id: Idbf0de3f953b08f98144241346533ad30f49269e Reviewed-on: https://gerrit.libreoffice.org/74285 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-04XSecController must be a complete type here (Windows --disable-pch)Stephan Bergmann1-1/+1
...when instantiating implicitly defined special member functions of XMLSECURITY_DLLPUBLIC XMLSignatureHelper, due to mpXSecController member Change-Id: Ifd504c1b215a8a1a86d7a9d660aa569b75e07d50 Reviewed-on: https://gerrit.libreoffice.org/73406 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-03tdf#39593 use UNO3_GETIMPLEMENTATION* macrosArkadiy Illarionov4-62/+6
Change-Id: I4e9af3b43a5baf19e100f42b3f37a2ade89ada5d Reviewed-on: https://gerrit.libreoffice.org/73320 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-29Removed duplicated includeAndrea Gelmini1-3/+0
In any case is included a few lines after, so I guess it can be removed the check (if it's not ready also for future other includes). Change-Id: Id603022092a60b71a5b35ec57930146d23c6544a Reviewed-on: https://gerrit.libreoffice.org/73093 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-27xmlsecurity: add missing includeMiklos Vajna1-0/+1
Broke the build on Ubuntu 18.04: In file included from /home/tinderbox/core-master/workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hpp:10:0, from /home/tinderbox/core-master/workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/Exception.hpp:8, from /home/tinderbox/core-master/workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/RuntimeException.hpp:8, from /home/tinderbox/core-master/include/com/sun/star/uno/Any.hxx:37, from /home/tinderbox/core-master/include/com/sun/star/uno/genfunc.hxx:27, from /home/tinderbox/core-master/include/com/sun/star/uno/Sequence.hxx:35, from /home/tinderbox/core-master/include/svl/sigstruct.hxx:27, from /home/tinderbox/core-master/xmlsecurity/inc/xsecctl.hxx:23, from /home/tinderbox/core-master/xmlsecurity/source/helper/xsecctl.cxx:22: /home/tinderbox/core-master/include/com/sun/star/uno/Reference.hxx: In instantiation of ‘static com::sun::star::uno::XInterface* com::sun::star::uno::Reference< <template-parameter-1-1> >::iquery(com::sun::star::uno::XInterface*) [with interface_type = com::sun::star::xml::crypto::XXMLSignature]’: /home/tinderbox/core-master/include/com/sun/star/uno/Reference.hxx:279:42: required from ‘bool com::sun::star::uno::Reference< <template-parameter-1-1> >::set(const com::sun::star::uno::BaseReference&, com::sun::star::uno::UnoReference_Query) [with interface_type = com::sun::star::xml::crypto::XXMLSignature]’ /home/tinderbox/core-master/xmlsecurity/source/helper/xsecctl.cxx:190:124: required from here /home/tinderbox/core-master/include/com/sun/star/uno/Reference.hxx:70:73: error: incomplete type ‘com::sun::star::xml::crypto::XXMLSignature’ used in nested name specifier return BaseReference::iquery(pInterface, interface_type::static_type()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ /home/tinderbox/core-master/solenv/gbuild/LinkTarget.mk:290: recipe for target '/home/tinderbox/core-master/workdir/CxxObject/xmlsecurity/source/helper/xsecctl.o' failed make[1]: *** [/home/tinderbox/core-master/workdir/CxxObject/xmlsecurity/source/helper/xsecctl.o] Error 1 Change-Id: I864da5bd6d163a3de35280bff367e6b51aced23d Reviewed-on: https://gerrit.libreoffice.org/73035 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-05-27operator new doesn't return null anywayStephan Bergmann1-5/+1
(and assigning nullptr to a null xcert was apparently redundant) Change-Id: I8b6120248c042adcb2f787b8db0f28c14268212d Reviewed-on: https://gerrit.libreoffice.org/73019 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-20writerfilter: make RTFParserState members private, part 1Miklos Vajna1-1/+2
Change-Id: Iae4d454e0b160ee7f5b39d252505748c693a9c9e Reviewed-on: https://gerrit.libreoffice.org/72554 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-15xmlsecurity: make DocumentSignatureManager members privateMiklos Vajna5-70/+85
Change-Id: I1262ca0dc2b2f843bdd6277415ee7967e9e59458 Reviewed-on: https://gerrit.libreoffice.org/72320 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin1-1/+1
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-12regenerate PCH headersLuboš Luňák2-36/+5
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-10an is used before a vowel soundCaolán McNamara1-1/+1
not before vowels with a consonant sound so its a url not an url Change-Id: Ic27ff3bee67469284d460c31ced6f63cb3633db2 Reviewed-on: https://gerrit.libreoffice.org/72062 Reviewed-by: Jens Carl <j.carl43@gmx.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-09Simplify Sequence iterations in xmlscript, xmlsecurityArkadiy Illarionov8-65/+40
Use range-based loops or replace with comphelper or STL functions Change-Id: I3d63811caf80c87a9d560087e1f0d933ebcc0d55 Reviewed-on: https://gerrit.libreoffice.org/72040 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>