summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)Author
2021-02-09default to CertificateValidity::INVALIDCaolán McNamara
so if CertGetCertificateChain fails we don't want validity to be css::security::CertificateValidity::VALID which is what the old default of 0 equates to notably commit 1e0bc66d16aee28ce8bd9582ea32178c63841902 Date: Thu Nov 5 16:55:26 2009 +0100 jl137: #103420# better logging turned the nss equivalent of SecurityEnvironment_NssImpl::verifyCertificate from 0 to CertificateValidity::INVALID like this change does Change-Id: I5350dbc22d1b9b378da2976d3b0abd728f1f4c27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110589 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-08tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctorTarun Sharma
Change-Id: Ib7f122b20734ad51c6326e369e5e7eee1bf08a21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109861 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-08update pchesCaolán McNamara
Change-Id: Icf55ddda055d11b649e7607c2cdd8b6d6ddfefbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110483 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-04log why status wasn't SECSuccessCaolán McNamara
Change-Id: Ibdbfdb9c6fd25165d584d35475909f0085896898 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110410 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-27tdf#115884 PDF signing should mention it only works with x509 certificatesVishwas
Change-Id: Ide93b5153824362ff3e3d16bea51c69e0dea1eb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108805 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-01-26loplugin:passstuffbyrefNoel
Change-Id: I330e0ab6c9955939dad313f9d472f93e39dbd313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109924 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-21remove deprecated [x|y]align property for CheckBoxes and RadioButtonsCaolán McNamara
the gtk default is left aligned, change the vcl one to match and drop the deprecated and unnecessary [x|y]align Unfortunately on load glade's inline preview shows centered alignment, though its "true" preview tool shows left alignment and unsetting and resetting draw-indicator will update the preview to show the alignment which will be used: https://gitlab.gnome.org/GNOME/glade/-/issues/502 See https://gitlab.gnome.org/GNOME/glade/-/merge_requests/110 for my stab at making glade do the right thing. Change-Id: If454e9ce8462e6b271d2423fe7e8a55788e01fac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-16drop unusual xalign 0.5Caolán McNamara
the whole widget is aligned start anyway so it makes no difference Change-Id: I2f7991eb20cd9df8580676c5be9fb863482bd464 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109419 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-16snap near 0.5 align values to 0.5Caolán McNamara
Change-Id: Idcedba97e1738f097a36845614a17f143c20c7c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109416 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-15replace stock button labelsCaolán McNamara
Change-Id: I726ba7846322863d9f38314b6c6ccc7f71124a0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109197 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-15tdf#138848 add truncate-multiline to all GtkEntries and GtkSpinButtonsCaolán McNamara
except for extensions/uiconfig/spropctrlr/ui/multiline.ui Change-Id: Ia2eca14332ffd4ac6e277c7529f17eca3ba29c0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109310 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-10fix coverity parse errorsCaolán McNamara
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26New loplugin:stringliteralvarStephan Bergmann
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-22drop deprecated GtkAlignment, move left/top-padding into child margin-start/topCaolán McNamara
for xmlsecurity, this uses the standard margin-top of 6, removing the additional 6 used in this one dialog Change-Id: Iac729122cc6e28fb17db3866bc7d8759861d3344 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108200 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-22replace deprecated xpad/ypadCaolán McNamara
drop entirely suspicious xpad/ypad which are probably accidental Change-Id: Ie80d93502359373e38cc61f63cd5bec962f5d193 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108115 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-22replace margin-left with margin-start and margin-right with margin-endCaolán McNamara
Change-Id: Iee3cc8c22b393ca420d0ed68673c61fe7ef240ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108113 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-21disable some more tests for non-default-dpiNoel Grandin
Change-Id: If5aecfb01685e2953fafdfc190054a28b9315bf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108054 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-19don't mention VclBuilder in the dialog tests docsCaolán McNamara
Change-Id: Id18a25e3d3310342887757fe417769f4213b8a3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107981 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-19make *String(string_view) constructors explicitNoel Grandin
to make it more obvious when we are constructing heap OUStrings code and potentially inadvertently throwing away performance. And fix a handful of places so revealed. Change-Id: I0cf390f78026f8a670aaab53424cd31510633051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107923 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-15update pchesCaolán McNamara
Change-Id: I280dea8fe5f346a5555f4bf479896877579d63e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107748 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-08use proper struct for trusted authorsNoel
instead of passing around a Sequence<String>, there is no need to use UNO types here. Change-Id: I1b9a1b6919f830d8ce29139b4362b979a669d505 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107396 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07move various notebookbar widgets into vclCaolán McNamara
and we can drop their factories then Change-Id: I1e261886dd7700710ba628da4bbeeba65efa1531 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107134 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-04disable tests that don't work without pdfiumCaolán McNamara
we're probably past the end of the road on --disable-pdfium Change-Id: Id91ea6c77bbdb3ecf609a7ffd16a278eb3b17e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107222 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-04update pchesCaolán McNamara
Change-Id: I3e22c2000da03f6f3345353846213203993aa865 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107192 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-26pdfium: replace PDFiumSignature::getPointer() with typed gettersMiklos Vajna
Once reason and time has getters, no need to expose the underlying PDFium type. Change-Id: I8f6b152fddf38e76ad7c3b1897fcb2026129820f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106631 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-25loplugin:stringviewparam (clang-cl)Stephan Bergmann
Change-Id: Id93a1c48cd0cc1aa8370498ce239035fc5c01730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106570 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-25loplugin:stringview (clang-cl)Stephan Bergmann
Change-Id: I47b44c80b2a5e3c9d84f5d7257efe17f138a1067 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106563 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-25pdfium: add sig getters: ByteRange, DocMDPPermission, Contents and SubFilterMiklos Vajna
Change-Id: Ieab577de92898568e27a879af1ca1bda170a307d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106554 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-20pdfium: add a signature wrapper classMiklos Vajna
It just hides the underlying FPDF_SIGNATURE, no real member functions yet. Change-Id: I37d27c26d6f05b1f8c697a5afe682c795e5d4d1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106184 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-19tdf#123936 Formatting files in module xmlsecurity with clang-formatPhilipp Hofer
Change-Id: I25c8d1a3c706f1ba7565a5f018b9660faf63ffaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105734 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-19pdfium: add signature and trailer end getter wrappersMiklos Vajna
So PDFiumDocument::getPointer() can be retired. Change-Id: I77c34c3e263bd6f39e06e50f621f2eaff804c716 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106079 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-17loplugin:stringviewparam check methods tooNoel
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-15add <!-- n-columns=1 n-rows=1 --> before every GtkGridCaolán McNamara
for a in `git ls-files '*.ui'`; do sed -i 's/^\( *\)\(<object class="GtkGrid".*\)/\1<!-- n-columns=1 n-rows=1 -->\n\1\2/' $a; done so we get the same behavior in glade as before 3.38 in that the grid preview don't show any unoccupied grid squares replace all existing n-columns=X n-rows=Y lines because they are all wrong, except for cui/uiconfig/ui/additionsfragment.ui sw/uiconfig/swriter/ui/pageheaderpanel.ui sw/uiconfig/swriter/ui/pagefooterpanel.ui which are correct. Change-Id: I401bbe8e098c26e7f57d6a872d3b70fc1ce85a00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105846 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-13xmlsecurity: verify signatures using pdfiumMiklos Vajna
And add a testcase with an odd PDF which were not handled by the old tokenizer but is handled by pdfium. Signature verification is happening implicitly while a document is opened, so it makes sense to use the more battle-tested pdfium to do this verification, instead of own code. (The APIs are somewhat low-level, so we can easily keep using our crypto stack for digest verification and our own certificate validation.) Signature creation still happens with the same own code, though. Change-Id: Ia64e84ab497422245e4ffd8a80a6a728cea84ff7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105766 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-11-11tdf#124176 Use #pragma once in xmlsecurityTRaXIn
Change-Id: I1e27a17575963d084eb761f5a715f451db4bac62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105522 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2020-11-05xmlsecurity: reject a few dangerous annotation types during pdf sig verifyMiklos Vajna
Change-Id: I950b49a6e7181639daf27348ddfa0f36586baa65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105312 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-26switching long to a 64-bit type on 64-bit windowsNoel
(*) create a rewriting plugin to do most of the work, heavily based on the fakebool plugin (*) but there are still a number of "long"s in the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-22set all .ui min require version of gtk to 3.20Caolán McNamara
and update the version mentioned in our min req in the readme.xrm follow up to commit 0c9ccc7dbf6deb4d012e0d1e6eb934e54e0f19bc Author: Caolán McNamara <caolanm@redhat.com> Date: Fri Oct 2 21:21:45 2020 +0100 raise min version of gtk to 3.20.0 Change-Id: Ibae55c97e1ee577f4b7435d124cda6a21005ad0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104692 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-21xmlsecurity: clean up last raw pdfium callMiklos Vajna
Change-Id: I4e6f28ef181fff5b7fc431aa01763370bb48476d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104577 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-21Avoid unused parameter 'nMDPPerm'Tor Lillqvist
Change-Id: I3ae13c66d76a61e197f214b2ffa8299de89a7a53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104612 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-10-20xmlsecurity: handle MDP permission during PDF verifyMiklos Vajna
Change-Id: I626fca7c03079fb0374c577dcfe024e7db6ed5b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104529 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-10-14More fixes of uses of now-explicit OUString ctor taking raw sal_Unicode pointerStephan Bergmann
...in Windows-only code, after c927aab29ebfff1ce3ac0b2f27ae343025a9890c "Make the OUString ctors taking raw sal_Unicode pointer/non-const array explicit". Interestingly, these occurrences were accepted by MSVC and only cause errors with clang-cl, so happened to go unnoticed until now. Change-Id: I33e7653e28a21541ef793b4b0750abb6037752db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104314 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: Idec482c21c270912f9bcaeb980077c1616f67c8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-02Fix libnssckbi not found error on AndroidMert Tumer
This error causes Android App to be unable to open Password-protected documents. Change-Id: Iacbacb1c780025752e2447db325b075c58947818 Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103658 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-09-30vcl: add PDFiumAnnotation::getObjectCount()Miklos Vajna
And use it in xmlsecurity, instead of the upstream scopers, to standardize on a single set of pdfium wrappers. Change-Id: Iec4baf34a607b23f1b9de8c4b969801c5973c1ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103636 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-25xmlsecurity: fold pdfio into pdfsignaturehelperMiklos Vajna
Most of the initial pdfio was moved to vcl as vcl::filter::PDFDocument. A small part was left here, because it depended on NSS. Then later the NSS bits were moved to svl::crypto::Signing. The rest is just a small amount of code, keeping that separate from PDFSignatureHelper, which is its only user makes little sense. With this, vcl::filter::PDFDocument is an implementation detail of PDFSignatureHelper during signature verification. Change-Id: I6230f9e46deeff7159970f88dbb3bd2de0e9ce7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103350 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>