Commit Graph
574 Commits
Author SHA1 Message Date
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
Miklos Vajna 9bd471cb76 xmlsecurity: clean up not needed C2U macro in xmldocumentwrapper
Also remove some auto-generated documentation that adds no useful
information.

Change-Id: I5e5c5dd6aaa3fb6953c38d6e82fa13737217c25c
Reviewed-on: https://gerrit.libreoffice.org/31748
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-12-08 09:17:53 +00:00
Tor Lillqvist 0b719cd36d No reason for these member functions to be virtual
Not sure what the author was thinking, or what the comment '//Native
methods' was supposed to mean.

Change-Id: I9e45de6f24531a99770d98f415fea6a1cfd7d2c2
2016-11-28 11:40:05 +02:00
Tor Lillqvist ed22c0cdb1 Bin SecurityEnvironment_MSCryptImpl::getPriKey() as it always returns NULL
Fallout from my previous commit.

Change-Id: I4436721e719514d6ecf7847113957827c910d65a
2016-11-28 11:40:05 +02:00
Tor Lillqvist fb414a04fc Bin SecurityEnvironment_MSCryptImpl::m_tPriKeyList as it was always empty
Change-Id: I5f35c702ff9a613c6601cd0c3c42e9fc4f4e26a6
2016-11-28 11:40:04 +02:00
Tor Lillqvist 0ddcff2053 No need for this local function to be externally visible
Change-Id: Idb2e716cdc4933c2691de2df21a4ee7afda9e597
2016-11-25 15:02:45 +02:00
Tor Lillqvist dcbfa4be9b Show also the message for the last Windows error in our own error handler
That is what the default libxmlsec error handler
xmlSecMSCryptoErrorsDefaultCallback() does. Why show less information
in our own handler?

Change-Id: Ibc9f9b5066536d0f5cabbf2bda6d1fa14eca5613
2016-11-24 11:57:21 +02:00
Tor Lillqvist 8b8f315b51 Nothing from that namespace used here
Change-Id: I05450a0af00b200145312301207b8f6d3af05145
2016-11-24 11:33:58 +02:00
Tor Lillqvist 8f08d48780 Bin copy-pasted comment that is meaningless here
Change-Id: Ie18a1bd4c006a9c7a54dc79747cb7e300315640a
2016-11-24 11:32:05 +02:00
Noel Grandin 5f77e6e930 update loplugin:unnnecessaryvirtual to handler destructors
and update modules writerfilter..xmloff with the resulting changes

Change-Id: I54d19c22ddb0ff579b32e4934d266c925b19305c
Reviewed-on: https://gerrit.libreoffice.org/30530
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-04 07:15:03 +00:00
Noel Grandin 1b36f23b51 loplugin:oncevar in xmloff..xmlsecurity
Change-Id: I2353d3c73130ed9420e8d803a9a96a06549bb6bd
Reviewed-on: https://gerrit.libreoffice.org/30429
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-31 10:32:27 +00:00
Noel Grandin 7477ab1391 loplugin:inlineablemethods in xmloff
Change-Id: I22202f85c65a862ccdafe1d521e2945e3d99252a
2016-10-18 08:51:07 +02:00
Stephan Bergmann 774e51d44c clang-cl loplugin: xmlsecurity
Change-Id: Ic101384ca32abb0d527f97d2cf695eb19c66da86
Reviewed-on: https://gerrit.libreoffice.org/29838
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-15 07:59:26 +00:00
Stephan Bergmann 91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Rosen 3c9d834af0 tdf#100726 Improve readability of OUString concatanations
concat string to easy readability

Change-Id: Ied5db1d74ad6266df558b859074257fd0049ad29
Reviewed-on: https://gerrit.libreoffice.org/27858
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-04 05:49:55 +00:00
Caolán McNamara 1ebd5de9de Related: tdf#95144 now merge common code into a shared CertExtn struct
Change-Id: I7514e092e4314d7cadee33df0e964362777b0b83
2016-07-28 12:37:12 +01:00
Caolán McNamara b073ef9331 Related: tdf#95144 rework to avoid bad casts
Change-Id: I89f84dae055b9a1058771021cb42dbc442405206
2016-07-28 12:37:12 +01:00
Caolán McNamara 2c110872b5 Related: tdf#95144 Revert fixes for bad casts and unused fields
Revert "Bad cast from SanExtensionImpl to CertificateExtension_XmlSecImpl"

This reverts commit 321b8ff86b.

Revert "loplugin:singlevalfields in writerfilter and xmlsec"

This reverts commit a25327e4b1.

cause these two together mean that we get a certificate is
invalid dialog when the cert is perfectly fine on loading https
sources

Change-Id: Id8c1fb5ece4ecc0035500ce0b822a6b248d14282
2016-07-28 12:37:12 +01:00
Noel Grandin cba5a9223a no need to create temporary OUString for comparison
Change-Id: I0a321e8ffbe379588a288084ec2e74e1a8c296b2
Reviewed-on: https://gerrit.libreoffice.org/27171
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-13 08:20:40 +00:00
Stephan Bergmann 321b8ff86b Bad cast from SanExtensionImpl to CertificateExtension_XmlSecImpl
...both ultimately derive from css::security::XCertificateExtension, but that is
all they have in common.  The special handling of 2.5.29.17 (and thus the bad
casts) was introduced with d5feca7dcd
"tkr38: #i112307# Support for x509 v3 Subject Alternative Name extension added".
Lets assume that it was an oversight there that setCertExtn (which is a function
of CertificateExtension_XmlSecImpl, not inherited from a---common---base class)
should not be called on such special-case SanExtensionImpl instances.

Change-Id: I96cfd42f606c79920d1548f323b68f17ff4e9081
2016-07-04 15:38:33 +02:00
Otto Kekäläinen 428e23f4f7 Fix some spelling errors in comments and strings
Change-Id: Iecd6b5e13d6be14651f77d8e37f01117ba15a11e
Reviewed-on: https://gerrit.libreoffice.org/26883
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-07-04 06:11:36 +00:00
Noel Grandin a25327e4b1 loplugin:singlevalfields in writerfilter and xmlsec
Change-Id: I51305ce4a6929b36f41eb7c7c83606ca8c5c89b8
Reviewed-on: https://gerrit.libreoffice.org/26691
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27 07:57:46 +00:00
Tor Lillqvist e0849330bc Get rid of unnecessary directory levels $D/inc/$D
Change-Id: Ibf313b8948a493043006ebf3a8281487c1f67b48
Reviewed-on: https://gerrit.libreoffice.org/25532
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-05-27 17:10:45 +00:00
Tor Lillqvist 2be281097f Add SAL_INFOs of the list of system and physical cert stores
Change-Id: I5c232e72c4a7fc18bc0f7ea29a9c912bf71284ba
2016-05-20 15:20:28 +03:00
Tor Lillqvist 5e0bdb52e9 Make X509Certificate_MSCryptImpl::getCertificateUsage() actually work
According to MSDN, calling CryptDecodeObject() with X509_KEY_USAGE
fills in a CRYPT_BIT_BLOB struct, not a CERT_KEY_USAGE_RESTRICTION_INFO
one.

Avoid potential complications of using CRYPT_DECODE_NOCOPY_FLAG.
Instead, just follow the normal pattern of first finding out the size
of buffer needed, allocate a such buffer, and then call the API again,
passing that buffer. When called without CRYPT_DECODE_NOCOPY_FLAG, at
least, it's what pbData points to that contains the usage bits, not
the pointer value itself.

Add SAL_WARNs for cleartext error messages in all error cases.

Change-Id: I9b9f7d08d6013753d127c723dedd959109a85c97
2016-05-19 19:16:37 +03:00
Noel Grandin 2383d557e5 clang-tidy misc-unused-alias-decls
Change-Id: Iabde7a84b9c2758e0d2b2ffe0fb99fcfa51ff124
Reviewed-on: https://gerrit.libreoffice.org/25075
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19 13:07:28 +00:00
Noel Grandin 96fab05132 clang-tidy modernize-loop-convert in writerfilter to xmlsecurity
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3
Reviewed-on: https://gerrit.libreoffice.org/24923
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-13 08:09:03 +00:00
Stephan Bergmann f3059ab1dc loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I96cef821fc1d87963b8928af5dfc8ba97557da74
2016-04-20 17:27:32 +02:00
Noel Grandin 789055bc2a clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.

Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:37:31 +00:00
Jochen Nitschke 97abbec956 tdf#94306 replace boost::noncopyable in stoc to xmlsec..
Replace with C++11 delete copy-constructur
and copy-assignment.
Remove boost/noncopyable.hpp includes.
Add missing default ctors.

With this commit there should be no users
of boost::noncopyable left.

Change-Id: I6b1e47824912a6a80cc3f00f34938ebc048d8975
Reviewed-on: https://gerrit.libreoffice.org/24051
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-13 11:19:04 +00:00
Stephan Bergmann 6d7366c80b -Werror,-Winconsistent-missing-override
Change-Id: I9e6a44fb54484aebc3f223b3c71d2de18bb5d553
2016-04-06 08:36:36 +02:00
Jochen Nitschke f7a75a66fa cleanup: remove unused Reference.h(xx) includes
and unused using-declarations from Reference.h

Change-Id: I297a7ae6044fa329d245ecf08fd5c4cb930f5b19
Reviewed-on: https://gerrit.libreoffice.org/23735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-02 19:01:24 +00:00
Miklos Vajna d78e644679 xmlsecurity: fix Windows XP build
xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx(511) :
error C2065: ´CERT_SHA256_HASH_PROP_ID´ : undeclared identifier

Change-Id: I644d6797d81a506ca9b91d83eead16503af93905
Reviewed-on: https://gerrit.libreoffice.org/23494
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2016-03-24 16:44:21 +00:00
Tor Lillqvist 869262bcc9 Re-introduce two lines apparently accidentally removed yesterday
... in 43d57d105d.

Change-Id: I07a1b9cb4edb34558c1b4aaf56a01b635de49f65
2016-03-15 08:13:25 +02:00
Noel Grandin 43d57d105d com::sun::star->css in xmlsecurity/
Change-Id: I4b89f97671ab526e5731d2f1f99802e23f3fd4b5
2016-03-14 13:28:04 +02:00
Wastack 7a0b8decb7 tdf#97966: Remove 'static' keywords
Change-Id: Id70f9e55fb4ad7d3a501399b055208ea10369c82
Reviewed-on: https://gerrit.libreoffice.org/23131
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-11 08:54:33 +00:00
Miklos Vajna eb63915f0a xmlsecurity: clean up no longer relevant email addresses
Change-Id: I224a0914bd3506b4e2ce057c53838ec78187b060
2016-03-11 09:11:38 +01:00
Stephan Bergmann b878666cd1 -Werror,-Winconsistent-missing-override
Change-Id: I1da31c370ce60ce107f70e9d8767af04297defca
2016-02-26 08:54:20 +01:00
Noel Grandin 3b168bc685 convert DocPasswordRequestType to scoped enum
Change-Id: I25d217ca2cf3e8cc4dfaccc6dc7d5453ffdc6cb6
2016-02-24 11:48:38 +02:00
Miklos Vajna 718dd3742b xmlsecurity: implement Certificate interface in X509Certificate_MSCryptImpl
Change-Id: Idf60c9adcbc6d7467df92b48995bcb5c0bc3465b
Reviewed-on: https://gerrit.libreoffice.org/22308
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-02-12 11:38:30 +00:00
Miklos Vajna f09f61c9b4 xmlsecurity: expose the certificate's SHA-256 checksum in the NSS backend
OOXML export will need an SHA-256 hash of the certificate, introducing
a css::security::XCertificate2 just for this would be probably an
overkill. The same will have to be done in the mscrypto backend in the
near future.

Change-Id: Id2df06416a713927edd60e1253ff8e1c09dd706a
2016-02-11 17:30:02 +01:00
Chris Sherlock a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Miklos Vajna 9c3ddf43bf xmlsecurity: validate OOXML <Manifest> references on Windows
This is the mscrypto equivalent of what was done in commit
e6aaf64cfc (xmlsecurity: validate OOXML
<Manifest> references, 2016-02-01) for NSS.

Change-Id: I7ee713fb5c7b55ded38100a0f25f718f2f323e08
2016-02-03 18:05:01 +01:00
Miklos Vajna e6aaf64cfc xmlsecurity: validate OOXML <Manifest> references
ODF uses no <Manifest> references, so this doesn't change anything for
ODF.

Previously we only validated the hash of a <Manifest> element, but not
reference hashes inside the <Manifest> element. This means now we can
detect not only changes to the signature metadata (signing data, signing
comment), but also changes in other streams, i.e. everything else.

libxmlsec already validated the manifest references hashes, the only
missing piece was that it's up to the client if it wants to validate
them, so libxmlsec doesn't do so by default -> our code has to.

This commit only affects the nss backend, still need to adapt the
mscrypto backend later presumably.

Change-Id: I0b11519d3eb003783048a00c4cada74762c6462f
2016-02-01 11:36:56 +01:00