Commit Graph

353 Commits

Author SHA1 Message Date
Miklos Vajna
4216d6f590 xmlsecurity: remove unused chainOn() argument
Change-Id: Id4d4ae41eb6d667a96ce5d294dd5bf3fcf4cb686
Reviewed-on: https://gerrit.libreoffice.org/43801
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-25 11:44:04 +02:00
Stephan Bergmann
35a2b55a13 loplugin:includeform: xmlsecurity
Change-Id: I9c3eca51fec52a255fcf280fe4e5ecc2ebbee5f3
2017-10-23 22:45:46 +02:00
Miklos Vajna
73ade0b029 xmlsecurity: remove unused m_xElementStackKeeper
Change-Id: Ibd7d39e288a4121428e83408ce67205eab3340c6
Reviewed-on: https://gerrit.libreoffice.org/43479
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-18 10:25:20 +02:00
Stephan Bergmann
fcc2dd7f1f Make include files found through -Ixmlsecurity/inc
...instead of implicitly next to the including file, in preparation of
loplugin:includeform

Change-Id: I81e3cd2dee707168064ff729f47e525b29bea43b
2017-10-16 17:32:51 +02:00
Miklos Vajna
d0211e091e xmlsecurity: remove unused XSecController::m_xNextNodeOnSAXChain
Change-Id: Ic5fd625afe2ef53968b87d1382b257e3d44ce08b
Reviewed-on: https://gerrit.libreoffice.org/43354
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-13 08:20:35 +02:00
Miklos Vajna
f1ad49892d xmlsecurity: last 2 params of setSAXChainConnector() is always nullptr
So remove them.

Change-Id: Iec2430af6634608bdc8c4beff6078ccceb7a2391
Reviewed-on: https://gerrit.libreoffice.org/43182
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-06 11:00:05 +02:00
Ashod Nakashian
b6d6591faf TSCP: include certificate usage in paragraph signatures
Change-Id: I6f4b891a016c67051efd9033329065d7e3c8a06b
Reviewed-on: https://gerrit.libreoffice.org/43022
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-10-05 14:47:29 +02:00
Noel Grandin
692d35b89a loplugin:finalclasses in xmloff
Change-Id: I10ffefd29b858548472a459314c7d5632324bca2
Reviewed-on: https://gerrit.libreoffice.org/43069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-03 13:22:00 +02:00
Mike Kaganski
cf48347e7a Fresh run of bin/update_pch.sh
Change-Id: I69d4157aaf6570cecd51ea59df20556914942e06
Reviewed-on: https://gerrit.libreoffice.org/42565
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-22 21:01:49 +02:00
Miklos Vajna
1cfcbf3573 xmlsecurity: hold SignatureCreatorImpl by rtl::Reference
Not going via UNO means explicit interface casting can be avoided.

Change-Id: I4fa2db810cade787913bca222530405d8d2eb6a9
Reviewed-on: https://gerrit.libreoffice.org/42573
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-09-21 11:43:52 +02:00
Thorsten Behrens
ca6ab632a8 gpg4libre: add sha512 support
Change-Id: Ia5ef54e47e8528a33aba83ae2e317fac5cffb428
Reviewed-on: https://gerrit.libreoffice.org/42086
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-09-10 01:42:55 +02:00
Miklos Vajna
c210019f36 xmlsecurity: no need to have pdfio/pdfdocument.hxx as a global header
Which means xmlsecurity can be again a module that has no public
headers.

Change-Id: I3d0b03680398f80196fac187263e770fd44ed0ed
Reviewed-on: https://gerrit.libreoffice.org/41966
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-09-06 09:06:19 +02:00
Stephan Bergmann
10bf5f34a8 loplugin:dyncastvisibility
Change-Id: I50c89b310da84e3d6a47b18114c20b4c35628a50
2017-09-04 13:42:58 +02:00
Katarina Behrens
4f6bf3d64c gpg4libre: Recycle certificate selection dialog for encryption
Change-Id: I699ecff1f62b3dae7ac275823c6721810589c4cf
Reviewed-on: https://gerrit.libreoffice.org/41507
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-09-03 01:09:48 +02:00
Miklos Vajna
feb463e93f xmlsecurity: fix inconsistent param naming in interface/implementation
Don't talk about enumeration when it's a number.

Change-Id: I756063534b38478c382eaf72829091a4e27a6c4f
Reviewed-on: https://gerrit.libreoffice.org/41779
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-09-01 10:33:33 +02:00
Miklos Vajna
86bc72072e xmlsecurity: work with impl directly in SignatureEngine::startEngine()
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-10 09:50:29 +02:00
Noel Grandin
61d49afadb loplugin:unusedmethods
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-08 20:56:30 +02:00
Caolán McNamara
b1d829e52e move resmgr to unotools
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-01 13:42:21 +01:00
Noel Grandin
871035d72a loplugin:constparams in various
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-08-01 12:30:55 +02:00
Noel Grandin
18f80da7a6 loplugin:checkunusedparams more part2
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-28 07:18:23 +02:00
Noel Grandin
b32ead5dd2 loplugin:checkunusedparams more part1
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-28 07:17:51 +02:00
Noel Grandin
b064a22f71 loplugin:constparams in xmlsecurity
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-27 10:58:32 +02:00
Noel Grandin
2fffaf6f05 loplugin:unusedmethods
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-25 12:03:50 +02:00
Caolán McNamara
00657aef09 migrate to boost::gettext
* 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::resource::OfficeResourceLoader
      com::sun::resource::XResourceBundleLoader
      com::sun::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-21 08:20:50 +01:00
Samuel Mehrbrodt
610254209a Move namespace declaration to header file
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-20 16:01:50 +02:00
Samuel Mehrbrodt
a83888e775 Fix warning for loext namespace
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-17 22:33:39 +02:00
Samuel Mehrbrodt
9127706ab3 gpg4libre: Wrap PGPOwner in own namespace
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-17 16:22:34 +02:00
Ashod Nakashian
4f17445c12 svl: move byte-array verification from vcl
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-17 00:12:10 +02:00
Armin Le Grand
83535a28c5 emfplus: create a wmf/emf/emf+ primitive based importer
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-15 11:01:29 +02:00
Miklos Vajna
4b7c522208 xmlsecurity pdf verify: push_back -> emplace_back
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-14 08:34:22 +02:00
Samuel Mehrbrodt
820bd4b3b6 tdf#108977 Show signature info also for keys we don't have locally
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-10 15:41:44 +02:00
Samuel Mehrbrodt
e2378bbf45 tdf#108711 GPG key selection should only be possible for ODF >= 1.2 documents
gpg4libre

Change-Id: I6dbdaefddacf55c9381d156ada20cb3f25d4b3cb
Reviewed-on: https://gerrit.libreoffice.org/39263
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-06-27 09:25:32 +02:00
Katarina Behrens
72f84c1a0e gpg4libre: Show certificate kind OpenPGP vs. X509 as 1 table column
Shuffled the columns around a little bit

Change-Id: Ib0a979458db680d712737ff997e1c3b4e4564f3f
Reviewed-on: https://gerrit.libreoffice.org/38984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-06-23 09:13:17 +02:00
Miklos Vajna
ab50f0b08b xmlsecurity: implement support for building against system-xmlsec
The only remaining difference is that in the system-xmlsec case we work
with the default key manager, not with the one that's only added by our
xmlsec patches.

This works for me for the uses I know of (see
<https://lists.freedesktop.org/archives/libreoffice/2017-February/076947.html>
for the motivation): signing and verifying of different signatures (bad
signature, good with non-trusted CA, good with trusted CA) with
software-based certificates all behave as expected.

Change-Id: If3f3e2b8373ab7397db3f98070a5a2ce51fa7c06
Reviewed-on: https://gerrit.libreoffice.org/39075
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-06-22 15:50:01 +02:00
Miklos Vajna
686dfc5ed5 xmlsecurity: fix loplugin:passstuffbyref warnings
Change-Id: I627abfe33e9c2fc4243276706c1624ce19943678
2017-06-22 09:06:31 +02:00
Thorsten Behrens
ba53bd4e72 gpg4libre: make signature impl swappable in-situ during validation
Sadly we only know whether its a OpenPGP or X509 signature during
parsing, so we need to switch the implementation mid-way

Change-Id: Ib48a9da0105de62cfecda095df8c154b59ba8c40
2017-06-21 22:16:56 +02:00
Thorsten Behrens
4ddb2f716f gpg4libre: some code improvements, add metadata for OpenPGP keys
Change-Id: I1beb692b9a9a34b5f0cf743ba9e4a145ac582184
2017-06-21 22:16:56 +02:00
Samuel Mehrbrodt
c88063e80d gpg4libre: Make viewing signatures work for gpg signatures
Change-Id: Ic10846cb87e23ca9ffa0eb0d64c56fcf79c73a9d
2017-06-21 22:16:56 +02:00
Thorsten Behrens
891d4b5d91 gpg4libre: write PGPData info, get more metadata out for gpg key
Change-Id: Ia560869ec02fca7fe4219136e1fe939e13f1e4c2
2017-06-21 22:16:55 +02:00
Samuel Mehrbrodt
ed92db7a50 gpg4libre: Init xmlsec in one place before creating the gpg/x509 services
Change-Id: I0308d586344b5e52ad327f6650b62ac0eac7ecb9
2017-06-21 22:16:55 +02:00
Samuel Mehrbrodt
b22fb3daf9 gpg4libre: Having this dllpublic should be fine now since it's in inc/
Change-Id: I79c132e717a62c6274eeafe33d732616cbd6a5a6
2017-06-21 22:16:55 +02:00
Samuel Mehrbrodt
9b8197ab0d gpg4libre: Make signature dialog work with two signing services
Change-Id: I0b47e6dba38222bb6b4f778c4206d3b37bc93089
2017-06-21 22:16:55 +02:00
Thorsten Behrens
06d7dbb356 gpg4libre: share static xmlsec lib between nss and gpg
In the end, the gpgme implementation uses enough of xmlsec
functionality that splitting those (and ending up with two copies)
was just not worth it.

Change-Id: Ida87c848e4e6a770e3c697add9ceb589a9ec3930
2017-06-21 22:16:55 +02:00
Miklos Vajna
9752eccdd0 xmlsecurity nss: adopt the private key of the signing certificate explicitly
xmlsec1-customkeymanage.patch.1 of our bundled xmlsec extends
xmlSecNssKeyDataX509VerifyAndExtractKey(), so that it calls
xmlSecNssPKIAdoptKey() for the private key of the signing certificate.
Make this explicit in xmlsecurity/ code, so we don't depend on the
patched xmlSecNssKeyDataX509VerifyAndExtractKey().

This is harmless for the patched xmlsec, but it prevents this error:

warn:xmlsecurity.xmlsec:26221:1:xmlsecurity/source/xmlsec/errorcallback.cxx:48: keys.c:1246: xmlSecKeysMngrGetKey() '' 'xmlSecKeysMngrFindKey' 1 ' '
warn:xmlsecurity.xmlsec:26221:1:xmlsecurity/source/xmlsec/errorcallback.cxx:48: xmldsig.c:790: xmlSecDSigCtxProcessKeyInfoNode() '' '' 45 'details=NULL'
warn:xmlsecurity.xmlsec:26221:1:xmlsecurity/source/xmlsec/errorcallback.cxx:48: xmldsig.c:503: xmlSecDSigCtxProcessSignatureNode() '' 'xmlSecDSigCtxProcessKeyInfoNode' 1 ' '
warn:xmlsecurity.xmlsec:26221:1:xmlsecurity/source/xmlsec/errorcallback.cxx:48: xmldsig.c:286: xmlSecDSigCtxSign() '' 'xmlSecDSigCtxSignatureProcessNode' 1 ' '

when xmlsec is not patched.

(This is needed, but not enough to build against system xmlsec.)

Change-Id: I5d68a8be7aefcb529566213f9b9c2985eab6a80a
Reviewed-on: https://gerrit.libreoffice.org/39023
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-06-21 09:05:14 +02:00
Noel Grandin
83f9325f0d loplugin:unusedfields xmlhelp..xmlsecurity
Change-Id: I7e680e1913c787ce0adad5be1f84668d57ad00b3
Reviewed-on: https://gerrit.libreoffice.org/38821
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16 08:24:49 +02:00
Katarina Behrens
28ae89f465 gpg4libre: add 'Start certificate manager' button
Change-Id: Ief3239fd1b3ff1f4e2e95e4413aa9f707f3dfb50
Reviewed-on: https://gerrit.libreoffice.org/36689
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-06-07 03:11:19 +02:00
Caolán McNamara
2155e04d63 make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString

drop various defines

drop unnecessary toString calls

Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-19 15:40:40 +02:00
Thorsten Behrens
c667669cf9 gpg4libre: fix windows build
Change-Id: I66b809bbf2f5ab5d9c1eaf40ba8f2c91f4bc8007
2017-05-18 09:19:32 +02:00
Thorsten Behrens
cae5f2a543 gpg4libre: initial GPG signature generation
* takes XML-Sec signature template
* calculates digest for all added reference streams
* produces signature value over canonicalized signature template
* writes same as detached signature into template, streams that out

Change-Id: I303e080dc25c440175fe1ae897f03cf356d5d0f2
Reviewed-on: https://gerrit.libreoffice.org/36106
Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-05-18 09:18:47 +02:00
Thorsten Behrens
0a5d6ac82f xmlsecurity: slightly more modern c++
Change-Id: I680bd57a492fe04dc98f2f61ff292e44e544a483
Reviewed-on: https://gerrit.libreoffice.org/37451
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-05-10 16:24:17 +02:00