Commit Graph

617 Commits

Author SHA1 Message Date
Noel Grandin
71112060e0 loplugin:oncevar various
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-29 08:18:35 +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
Thorsten Behrens
9ea64f959c related: gpg4libre: Init xmlsec in one place before creating the services
Last holdout for separate xmlSec init removed, cf.
ed92db7a50

Change-Id: I46a05074706bba77ebc488f0df296e35e2b7d553
2017-06-22 13:26:46 +02:00
Thorsten Behrens
f9a14f3d02 gpg4libre: fix build for windows and mac
Change-Id: I3e36b22cefba4c6195bcf8b85b3f7a2cc101b845
2017-06-21 22:16:56 +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
Katarina Behrens
bb06a106aa gpg4libre: [API-CHANGE] add certificate kind (X509 vs. OpenPGP)
Change-Id: I423bef41f93af9d1b78ee9795be7ec33c3c7ae0c
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
Jochen Nitschke
a5dba7dbec remove unused osl/mutex.hxx includes
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb
Reviewed-on: https://gerrit.libreoffice.org/38905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-18 13:38:25 +02:00
Jochen Nitschke
a3bedb7ae8 use local statics for getUnoTunnelImplementationId
replace uses of double checked locking pattern and
rtl::Static

Change-Id: I479d9d94f652b4fb4c67388405823a5f4e2b6ed4
Reviewed-on: https://gerrit.libreoffice.org/38690
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-13 09:13:37 +02:00
Noel Grandin
1dd5e226bd clang-tidy readability-non-const-parameter
Change-Id: I7b2680898dbfc49185fb949349d81f4ac615a470
Reviewed-on: https://gerrit.libreoffice.org/38593
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-09 15:05:54 +02:00
Noel Grandin
ef513fd4b0 remove unnecessary use of OString::getStr
Change-Id: I0490efedf459190521f4339854b3394d57765fdb
Reviewed-on: https://gerrit.libreoffice.org/38058
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-28 19:44:08 +02:00
Noel Grandin
24b2c636a2 create SAL_RETURNS_NONNULL annotation
and apply it to some methods in OString and OUString

Change-Id: I30e91f961b6d310799d3641f68b7ed54b3080f3a
Reviewed-on: https://gerrit.libreoffice.org/38020
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-26 10:35:30 +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
Miklos Vajna
273da4e3d1 xmlsecurity: use xmlsec API instead of patching out cert verification
This flag does exactly what we need since xmlsec-1.2.24.

Change-Id: I3ae052d4bfe564c3234aef2511ef82ebdb452ebe
Reviewed-on: https://gerrit.libreoffice.org/37700
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-05-17 10:20:50 +02:00
Stephan Bergmann
4345cdb85a Clean up uses of SAL_U/SAL_W: xmlsecurity
Change-Id: I96043623a5b0e26ddc44de5c71743f3b0d8e1e50
2017-05-11 11:17:11 +02:00
Chris Sherlock
97eb00c75e revert OSL_ASSERT changes
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07 17:03:35 +10:00
Chris Sherlock
a85694c4c7 tdf#43157: convert xmlsecurity module away from OSL_ASSERT to assert
Change-Id: Ib5297ceb307e8f8d475b7ff0523e6a57f72434a5
2017-05-07 13:03:03 +10:00
Stephan Bergmann
eec04f7f04 loplugin:useuniqueptr (clang-cl)
Change-Id: I32c69544b40c2398f415e3aaa9beb470694f0290
2017-04-18 08:42:02 +02:00
Andrea Gelmini
3c3f7d784e Removed duplicated includes
No automatic tools. Manual checked and tested.

Change-Id: Ife260fa4e1d786cf81f2917a901664cc54943754
Reviewed-on: https://gerrit.libreoffice.org/36371
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-13 07:46:16 +02:00
Stephan Bergmann
9ac98e6e34 Finally switch MSVC to sal_Unicode = char16_t, too
There is lots of (Windows-only) code that relied on sal_Unicode being the same
as wchar_t, and the best change may be different in each case (and doing the
changes may be somewhat error prone).  So for now add SAL_U/SAL_W scaffolding
functions to sal/types.h, remove their uses one by one again, and finally drop
those functions again.

Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea
Reviewed-on: https://gerrit.libreoffice.org/36077
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04 16:12:11 +00:00
Andrea Gelmini
74117f9597 Fix typos
Change-Id: I901ff35ad2e0aa43a421f0996865130514a819bc
Reviewed-on: https://gerrit.libreoffice.org/35663
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 13:10:53 +00:00
Stephan Bergmann
fe7a5fe993 loplugin:subtlezeroinit (clang-cl)
Change-Id: I0a36bcf15fff74ed2f707608e04ad6596614dfd1
2017-03-14 14:49:58 +01:00
Miklos Vajna
42460fd4eb xmlsecurity: avoid using the SerialNumberAdapter wrapper
This service is only used in xmlsecurity and it's a wrapper around two
free functions in the same module.

Change-Id: Ibc5a026b51eda6c2b4b27b7254dedc220dbf909a
Reviewed-on: https://gerrit.libreoffice.org/34772
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-02 08:35:54 +00:00
Samuel Mehrbrodt
baee96e04a Remove commented out code
Change-Id: I1da07c52380e543b80c7725a8420c1927743257d
Reviewed-on: https://gerrit.libreoffice.org/34587
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-02-23 16:47:24 +00:00
Samuel Mehrbrodt
3788d6a264 Remove commented out code
Change-Id: I36e5f4072ac52a3073d13e4ad5185ead7611e722
Reviewed-on: https://gerrit.libreoffice.org/34586
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-02-23 16:36:21 +00:00
Stephan Bergmann
7dedccd06d loplugin:subtlezeroinit: xmlsecurity
Change-Id: Ife06c74e1665273350b497a1a584d7f76297c13d
2017-02-21 07:34:54 +01:00
Jochen Nitschke
696479aafa cppcheck: redundantAssignment
Change-Id: I4537ced9dafb5b20dbf8cfb7d335698536067c49
Reviewed-on: https://gerrit.libreoffice.org/34436
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-20 06:04:06 +00:00
Stephan Bergmann
8ca2d453e3 Some simplifications, using UNO_QUERY_THROW
Change-Id: I6e7555472da6b23af4c64b299182339a5b324ee9
Reviewed-on: https://gerrit.libreoffice.org/34250
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-15 14:16:26 +00:00
Stephan Bergmann
fed3783e77 Add missing #includes
...like 6dce9c6757, for Windows-only code

Change-Id: I35f37aae2e6f55ff8ed82afc710a9b59a43b028c
2017-02-08 08:40:06 +01:00
Stephan Bergmann
6dce9c6757 Add missing #includes
...and remove some unncessary using directives/declarations, in preparation of
removing now-unnecessary #includes from cppumaker-generated files, post
e57ca02849 "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01:00
Stephan Bergmann
5595ee701e loplugin:useuniqueptr
Change-Id: I3a246a22baaac8195dc1b94c42994de7d80e8336
2017-02-02 15:17:52 +01:00
Julien Nabet
018ed00d5b cppcheck: postfix operator
Change-Id: I2b6f0c922b0e70ecbf79f60831ff5d71cd1438fb
Reviewed-on: https://gerrit.libreoffice.org/33656
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-29 09:46:36 +00:00
Noel Grandin
4142e0a0c0 loplugin: unnecessary destructor writerfilter..xmloff
Change-Id: I511822dc874101ed3b9850b015b746a86d26c3b5
Reviewed-on: https://gerrit.libreoffice.org/33578
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27 06:51:11 +00:00
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Stephan Bergmann
8cb18eb82d loplugin:dynexcspec (clang-cl), xmlsecurity
Change-Id: Iaa817d1da0c648c3a1feb0ef1e4500808a868644
2017-01-20 11:53:29 +01:00
Stephan Bergmann
8ccd11e1ae New loplugin:dynexcspec: Add @throws documentation, xmlsecurity
Change-Id: I2447c028add359952e4bd36dbdc1d5431fe48104
2017-01-19 18:03:08 +01:00
Caolán McNamara
f6572fa96c tweak to avoid coverity#1371169 Missing move assignment operator
Change-Id: I0d29ce18c19c26a7526dad98d77db4670d0c5303
2017-01-19 10:02:13 +00:00
Caolán McNamara
16c9933666 convert to std::vector
Change-Id: I77ac7701ccb35aa32152d85a20fc59ed0bd942cf
2017-01-18 21:33:47 +00:00
Stephan Bergmann
33c81a4580 loplugin:externvar (clang-cl)
Change-Id: I6f4c294cb15a4426545d05be7b0a7f26f580563c
2017-01-11 13:42:42 +01:00
Stephan Bergmann
a32c0f4a1e New loplugin:externvar: xmlsecurity
Change-Id: I25ee9a65b481c63ab2629be54768793d254341b5
2017-01-09 15:38:51 +01:00
Tor Lillqvist
b1c1458760 Revert "[API CHANGE] createSecurityContext() was always called with an empty string"
I got cold feet. I don't want to have to revert this many years later
instead, when some obscure 3rd-party software stops working.

This reverts commit e1ce7bad62.
2016-12-22 08:48:16 +02:00
Tor Lillqvist
e1ce7bad62 [API CHANGE] createSecurityContext() was always called with an empty string
So drop the parameter then and propagate fallout in the Windows
implementation in xmlsecurity. The NSS implementation already ignored
the parameter completely.

This interface is not 'published' and the parameter was even marked as
'reserved for internal use' so I doubt any external code has used it.

Change-Id: I5915b941b79cfddadc8137c32ed07c20c9ccaa37
2016-12-21 21:24:09 +02:00
Tor Lillqvist
317278525a Bin now unused fields
Change-Id: Ie2179bc61ca59a5f5ea2bed1c5c0b2c1dea55474
2016-12-21 17:49:18 +02:00
Tor Lillqvist
62fe303d16 Bin now unused functions
Change-Id: I515279becbb219c94a52bb1ebf9d1ab33402dae0
2016-12-21 17:49:18 +02:00
Tor Lillqvist
efe9d1df69 Don't add empty TODO functions to libxmlsec, and don't call them
Change-Id: Iaec1de29a0e7f3ea8eb10869382401d121de2c8a
2016-12-21 17:35:24 +02:00
Stephan Bergmann
54c401d775 loplugin:staticmethods (clang-cl)
Change-Id: Id97600a7d29fbe938d67ea074ca12dd665a29cc3
2016-12-16 15:28:40 +01:00
Miklos Vajna
a7c35729e0 xmlsecurity: hold XMLDocumentWrapper by rtl::Reference in XSecController
Going via UNO for a class in the same module is an overkill.

Change-Id: Idf706782e5844fd2e553c44966e1dd1104dce8e7
Reviewed-on: https://gerrit.libreoffice.org/32030
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-12-15 09:15:38 +00:00