summaryrefslogtreecommitdiff
path: root/xmlsecurity
AgeCommit message (Collapse)AuthorFilesLines
2017-08-11convert std::map::insert to std::map::emplaceNoel Grandin1-2/+2
which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-10xmlsecurity: Log unknown xml elements for ooxmlSamuel Mehrbrodt1-0/+4
Change-Id: I0daf81ac91da1d6206282e486298d059b937bb21 Reviewed-on: https://gerrit.libreoffice.org/40819 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-08-10xmlsecurity: work with impl directly in SignatureEngine::startEngine()Miklos Vajna8-24/+15
The only implementation of css::xml::crypto::XXMLSignatureTemplate is XMLSignatureTemplateImpl, so work with that directly instead of going via UNO. Change-Id: I85e2169a909b689620c2ce125a9653f9a6696f45 Reviewed-on: https://gerrit.libreoffice.org/40950 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-08-08loplugin:unusedmethodsNoel Grandin2-15/+0
Change-Id: Id66cf12e3a59aeed1b9a7a111b841e30b248635b Reviewed-on: https://gerrit.libreoffice.org/40876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03xmlsecurity: remove unused XMLEncryption_MSCryptImplMiklos Vajna6-519/+0
This is unused since commit 2303d4f1a2b7e25fe864323adeec398057cebe72 ([API CHANGE] offapi: remove unused css.xml.crypto.XMLEncryption, 2017-07-18). Change-Id: Icaf5054f13271a9040137f305bd7be40d1be6600 Reviewed-on: https://gerrit.libreoffice.org/40699 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-08-02remove unnecessary use of 'this->'Noel Grandin2-5/+5
Change-Id: I5c115389af7d24c18ddaf5fbec8c00f35017a5b4 Reviewed-on: https://gerrit.libreoffice.org/40671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-01move resmgr to unotoolsCaolán McNamara3-3/+3
and the vast majority of translations is to the ui language so default ctor with that arg and now drop OModuleResourceClient Change-Id: I3b85a560ffdfe5f019c2271ac56a5fe4a361522b
2017-08-01loplugin:constparams in variousNoel Grandin2-4/+4
Change-Id: Id15f3562f42afa6c679cea3c839172557ead0395 Reviewed-on: https://gerrit.libreoffice.org/40624 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28loplugin:checkunusedparams more part2Noel Grandin4-22/+0
Change-Id: Ibb940c2a7098313dfa282734894b1abc1ac40bc2 Reviewed-on: https://gerrit.libreoffice.org/40489 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28loplugin:checkunusedparams more part1Noel Grandin2-10/+0
seems I got one of the checks wrong, and was missing a bunch of stuff Change-Id: I2c662fc4e735f8d6cbe56c6f82906a60a580331b Reviewed-on: https://gerrit.libreoffice.org/40481 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-27loplugin:constparams in xmlsecurityNoel Grandin9-33/+33
Change-Id: I41f153af55262d201c0fb024460de0e9f1c14670 Reviewed-on: https://gerrit.libreoffice.org/40472 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-27xmlsecurity mscrypt: drop unused parameters in akmngrMiklos Vajna3-13/+3
Change-Id: I5e8b3e472caa058c4c8f10b423783d963a6ab1c0 Reviewed-on: https://gerrit.libreoffice.org/40465 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-26xmlsecurity: remove unused XMLEncryption_NssImplMiklos Vajna3-339/+0
This is unused since commit 2303d4f1a2b7e25fe864323adeec398057cebe72 ([API CHANGE] offapi: remove unused css.xml.crypto.XMLEncryption, 2017-07-18). Change-Id: Iefe201a9e93fc02e1295d23ad1b6c27286547241 Reviewed-on: https://gerrit.libreoffice.org/40434 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-25loplugin:unusedmethodsNoel Grandin2-41/+0
Change-Id: Ia874baf21257e5fe41e104211068a2bcc50446eb Reviewed-on: https://gerrit.libreoffice.org/40391 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21Eliminate DateTime::operator+=() and -=() with POD typesEike Rathke1-2/+2
And make some tools::Time conversion ctors explicit to catch more oddities like automatic conversion from sal_Int64 that might be unintentional. Change-Id: If275297d86d6657544c056a712b862523e310e44 Reviewed-on: https://gerrit.libreoffice.org/40275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-07-21Fix typosAndrea Gelmini1-1/+1
Change-Id: I43f38b4dda6b1999d84d9f9760d0fae4c0358394 Reviewed-on: https://gerrit.libreoffice.org/40277 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-07-21migrate to boost::gettextCaolán McNamara26-411/+159
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-20Move namespace declaration to header fileSamuel Mehrbrodt2-2/+2
Change-Id: I5388d649ff3c8da0ff055f4aed6036647a123939 Reviewed-on: https://gerrit.libreoffice.org/40130 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-20xmlsecurity mscrypt: turn akmngr patch into plain codeMiklos Vajna5-2/+291
This is just a set of C functions accessing public libxmlsec API, it's perfectly OK to have this in xmlsecurity/ instead of patching the bundled libxmlsec for this. Change-Id: Ib3e746883a47b80626fdcd64149ce50aa0588395 Reviewed-on: https://gerrit.libreoffice.org/40209 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-07-19[API CHANGE] offapi: remove unused css.xml.crypto.XMLEncryptionMiklos Vajna2-6/+0
This is mostly just the offapi/ part, more C++ code can be removed in xmlsecurity/ after this. XMLEncryption wasn't used by internal code since it was added in commit 9f34fde7a8750b856570b5e855d2ecb226bf0c23 (libxmlsec, 2004-07-12). It seems to be unlikely that this non-published service was used by 3rd-party code, since it was specific to other xmlsecurity/ code, not generic functionality that could be useful in other contexts. Change-Id: Ia0168f67d1c8ff7a019760ac436511f219eee94e Reviewed-on: https://gerrit.libreoffice.org/40162 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-07-18coverity#1415512 silence Unchecked return valueCaolán McNamara1-1/+1
Change-Id: I50601be72a5f496c1d1e8135af57db649e29110a
2017-07-18Fix typosAndrea Gelmini1-1/+1
Change-Id: If6023dfa1d90f79185197622a738373a189ea6af Reviewed-on: https://gerrit.libreoffice.org/40118 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-18We no longer patch libxmlsec for thisSamuel Mehrbrodt1-7/+3
Change-Id: I0e817499e80d2b7292833f5e734974b05ef579b6 Reviewed-on: https://gerrit.libreoffice.org/40041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-07-17Fix warning for loext namespaceSamuel Mehrbrodt4-10/+7
Define the namespace near the element that's using it Change-Id: If0a135a331d4f67ef2dfe4981e93110e7a1a787a Reviewed-on: https://gerrit.libreoffice.org/40084 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-17This should be a namespace, not an attribute "namespace"Samuel Mehrbrodt1-5/+3
Change-Id: I159db32662679a3194edf942fa6672370e2b8587 Reviewed-on: https://gerrit.libreoffice.org/40072 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-07-17gpg4libre: Import public key payload if verification result != validKatarina Behrens1-5/+14
it is essential to look closer at the results of verification (code doing that was removed by commit bdbebda1d80f538f946b14042) to be able to proceed with importing public key payload from the file if needed I've also killed one more instance of xmlStrlen being used on binary data Change-Id: I8cd45fe963c8dde91727471ddbebe6943374a121 Reviewed-on: https://gerrit.libreoffice.org/40066 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-17loplugin:unnecessaryparen: xmlsecurity (clang-cl)Stephan Bergmann1-3/+3
Change-Id: Iaef0f4dda4ea4cb2d3bb67d9007873c89b9aa5c5
2017-07-17gpg4libre: Wrap PGPOwner in own namespaceSamuel Mehrbrodt3-2/+10
as recommended by W3C: https://www.w3.org/TR/xmldsig-core/#sec-PGPData Change-Id: I2cc0ae24eefc9137d2e3432da1d65e44245c7616 Reviewed-on: https://gerrit.libreoffice.org/40058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-17gpg4libre: use full SHA1 hash for key identificationThorsten Behrens4-15/+20
Read and write full 20 bytes/40 hex chars of SHA1 key hash, instead of some abridged versions. See also https://lists.debian.org/debian-devel/2016/08/msg00215.html Change-Id: I741afc94ac7cf559880fe55ff02420723e13310d Reviewed-on: https://gerrit.libreoffice.org/40027 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-17gpg4libre: unconditionally use binary IOThorsten Behrens1-0/+1
Regardless of changing gpgme defaults, we don't want ascii armor anywhere. Change-Id: Ic1e80e134b8f24d05d6549ef19c5a82220718f1f Reviewed-on: https://gerrit.libreoffice.org/40022 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-17gpg4libre: search for _all_ local keys in getCertificate()Thorsten Behrens1-1/+1
Otherwise, newly-imported ones will not show up, which is bad when trying to figure out how much we trust a key in DocumentDigitalSignatures::ImplVerifySignatures() Change-Id: I771cf71b5e0ddb5cc76db94d7ada4c5291fe56f1 Reviewed-on: https://gerrit.libreoffice.org/40023 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-17svl: move byte-array verification from vclAshod Nakashian11-777/+12
Also use comphelper::Base64 and DateTime::CreateFromUnixTime to avoid depending on sax. Change-Id: If1853f8d9481c9caa0625a111707531bbc495f75 Reviewed-on: https://gerrit.libreoffice.org/39993 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-07-15emfplus: completed isolation/migration of Emf/WmfArmin Le Grand1-1/+1
Decided to keep the migrated/isolated Emf/Wmf reader which are now hidden behind a Uno Api. Had to re-implement WMF_EXTERNALHEADER (now WmfExternal, own file/header) to not break anything. It *seems* to just scale something and could be done after import, but I could not be sure. Also needed a callback hook to allow getting the Metafile out of a MetafilePrimitive in a lower module (vcl relative to drawinglayer) which is needed as long as primitives are not completely on Uno Api. Deleted all Emf/Wmf reader stuff from vcl. Change-Id: Ic5540defa8ec770728280df4df3f12e1f48cfc3a
2017-07-15emfplus: create a wmf/emf/emf+ primitive based importerArmin Le Grand1-1/+1
First steps to organize an importer that can read/interpret wmf/emf/emf+ and deliver a primitive representation for the content by parsing it. Use the same mechanisms as already applied for Svg, so to reuse abilities to keep original binary data to allow save again and embedding in files and have an implemented replacement bitmap based representation. For this, unify the used helper classes to handle more than just Svg. For 1st try, add test code and static bool switches Change-Id: I6e0a82943541d811a8f8d65a84115569fcd8cee7
2017-07-14tdf#108831 PGP signature shown as invalidSamuel Mehrbrodt1-6/+2
It was valid, but not trusted. We need to show the owner trust in another place. gpg4libre Change-Id: I344a7b064a22c16b647c73d52f7abd91cfc86be9 Reviewed-on: https://gerrit.libreoffice.org/39826 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-14gpg4libre: Show whether pgp keys are trusted or notSamuel Mehrbrodt2-31/+43
Owner trust levels considered valid keys: Marginal Full Ultimate Owner trust levels considered invalid keys: Unkown Undefined Never Change-Id: I7338b587acfd105ca24e40b45960cea8d2c04ded Reviewed-on: https://gerrit.libreoffice.org/39952 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-14gpg4libre: Don't use xmlStrlen on binary dataKatarina Behrens1-2/+3
Odd things happen inside gpgme if the buffer is prematurely truncated due to \n char and valid signature is then evaluated as invalid Change-Id: I24d4d22af06a3dde6eb7fdfc12953cf1b5f19c1e Reviewed-on: https://gerrit.libreoffice.org/39945 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2017-07-14use more OUString::operator== in test..xmlsecurityNoel Grandin5-11/+11
Change-Id: If5bdd1532be44a47ff7cc3b769be3ea585aea562 Reviewed-on: https://gerrit.libreoffice.org/39685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-14xmlsecurity pdf verify: push_back -> emplace_backMiklos Vajna2-2/+2
And a few other similar small cleanups. Change-Id: I91c992f33f2166d1cf27cbc9def1b69965040658 Reviewed-on: https://gerrit.libreoffice.org/39928 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-12strip some linefeeds from the end of debug outputNoel Grandin1-1/+1
Change-Id: I2821969d86b7f8cee53404e6a0acfbebbe53b3ac Reviewed-on: https://gerrit.libreoffice.org/39824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10tdf#109046 Show correct signature type for OpenPGPSamuel Mehrbrodt1-1/+4
gpg4libre Change-Id: I9c05f68e16928d14a29058f5bb9aa35c90b8f48b Reviewed-on: https://gerrit.libreoffice.org/39744 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-10Related tdf#108977 Fix crash when vieweing non-existing certificateSamuel Mehrbrodt3-1/+11
gpg4libre Change-Id: If72c2ee818b67b48753ee293de4f02b4832b9d96 Reviewed-on: https://gerrit.libreoffice.org/39743 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-10tdf#108977 Show signature info also for keys we don't have locallySamuel Mehrbrodt11-27/+76
gpg4libre Change-Id: I89593224590007e61bce95c14922c08551282067 Reviewed-on: https://gerrit.libreoffice.org/39742 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-07-06use OString::operator== in preference to ::equalsNoel Grandin1-2/+2
Change-Id: Ib291521963a791a9c6175964571e9d9895072acf Reviewed-on: https://gerrit.libreoffice.org/39646 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06loplugin unnecessaryparan improvementsNoel Grandin1-1/+1
Change-Id: I73e945d6ec53537a0da45f6b6291018c7f251a7e Reviewed-on: https://gerrit.libreoffice.org/39587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03loplugin:oncevar (clang-cl): xmlsecurityStephan Bergmann2-5/+6
Change-Id: Ic5e4dac2626474dd3d44ef5097522bc7e2207cd1
2017-07-02xmlsecurity: avoid crash on empty security contextThorsten Behrens1-0/+2
This should prevent 8cf224c2-f9b9-44e1-9cb0-fc452e570886 Change-Id: I1ad4d8437923eb677d574c2c469cc62378c9c7a6 Reviewed-on: https://gerrit.libreoffice.org/39430 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-06-30loplugin:staticmethodsStephan Bergmann1-0/+2
Change-Id: I68d02b89a2c55e41ad0d86392ed3994fa5410fac
2017-06-29loplugin:oncevar variousNoel Grandin7-29/+15
Change-Id: I8b82d46d4688b1a59d6fe1b05da7d5c8dfc13ca6 Reviewed-on: https://gerrit.libreoffice.org/38766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28Fix typosAndrea Gelmini1-1/+1
Change-Id: I59777c29fe20f112327ce28a1c0b9cdd2f60857c Reviewed-on: https://gerrit.libreoffice.org/39354 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>