summaryrefslogtreecommitdiff
path: root/package
AgeCommit message (Collapse)AuthorFilesLines
2018-08-28Related rhbz#1618703: Properly handle failure encoding zip fileStephan Bergmann1-41/+34
...when e.g. FIPS mode makes ZipFile::StaticGetCipher fail by throwing an exception which would be caught by ZipPackageStream::saveChild (in package/source/zippackage/ZipPackageStream.cxx) alright (and translated into bSuccess = false), if ZipFile::StaticGetCipher didn't unhelpfully swallow and ignore all exceptions in an outer try-catch. Change-Id: I14376128515df1dd4bdac921edd8ab94cc9b7617 Reviewed-on: https://gerrit.libreoffice.org/59514 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 3cc6d3611ac8cbbfb9803f3a084d02edde470ad3) Reviewed-on: https://gerrit.libreoffice.org/59569 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-30ODF1.3: import new OpenPGP encryption markupThorsten Behrens3-6/+63
With OFFICE-3940 the loext markup got accepted for ODF1.3 (and the redundant KeyInfo element removed). Make sure manifest parser can import new markup. Change-Id: Id3c88654e8e6e0e256cd68fbb43f1ef670849cf7 Reviewed-on: https://gerrit.libreoffice.org/56597 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit a7bf6488ebb544e1efaed0a1e53073df9cc2064d) Reviewed-on: https://gerrit.libreoffice.org/56677
2018-06-05package: fix pretty-printing in manifest exporterThorsten Behrens1-1/+1
Change-Id: If8c88994f68a8a644d1ce4e2386d3247140e824f Reviewed-on: https://gerrit.libreoffice.org/55322 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 6e851bb1286da592bc180ed722f8c8ec5e1f18f0) Reviewed-on: https://gerrit.libreoffice.org/55340
2018-04-23loplugin:useuniqueptr in OZipFileAccessNoel Grandin2-4/+3
Change-Id: Iaad8b364b1a244bd559e582a1622dd59b4756759 Reviewed-on: https://gerrit.libreoffice.org/53226 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-23loplugin:useuniqueptr in SwitchablePersistenceStreamNoel Grandin2-12/+8
Change-Id: I8f7d8296b98bc1743b993aac195859b2d2be4f7f Reviewed-on: https://gerrit.libreoffice.org/53225 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-23loplugin:useuniqueptr in Inflater,DeflaterNoel Grandin2-26/+24
Change-Id: I55833664a6e76d781908b8f1f721dd9a4946e35f Reviewed-on: https://gerrit.libreoffice.org/53224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-11new loplugin:unusedvariablemoreNoel Grandin1-3/+1
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-09forcepoint#37 revert tdf#108572 let remove storage elementCaolán McNamara1-2/+0
reverts commit 26957fc325c27cf61e8ef5555b380d627def4931 Date: Wed Sep 6 10:54:50 2017 +0200 tdf#108572 let remove storage element void OStorage_Impl::RemoveElement( SotElement_Impl* pElement ) expects that m_pAntiImpl will be nullptr, if not throws an exception. This caused that in case of deleting embedded database used for mail merge it wasn't fully removed and The problem is that by allowing the removal of the element, existing readonly accessors are left pointing to the deleted element which causes quite some problems as seen in this sample document Change-Id: Ie6ac36e6dea771b02637d77b78eb8026e3bb7ae8 Reviewed-on: https://gerrit.libreoffice.org/52563 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke2-2/+0
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-30weld SvxCharacterMap dialogCaolán McNamara1-0/+7
and SmSymDefineDialog There's a whole bunch of interrelated stuff which needs to work at the same time. add menu support, keyboard support, better mouse support, a gtk scrollable adaptor to support pseudo scrolling drawing bodge, plugable uitest support for custom widgets, plugable a11y support for custom widgets via the existing atk_object_wrapper_new wrapper for XAccessible In this specific case, change SvxCharacterMap from something that has an internal scrollbar to a scrolledwindow where the scrollbar is external, which drops the need for the a11y impl of SvxCharacterMap to emulate being a scrolled window and internal table and just needs the table a11y impl Change-Id: Ia2743d6958021c525a1900154dcbb69ae33fc400 Reviewed-on: https://gerrit.libreoffice.org/52084 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-17Typos concerning hierarchyJulien Nabet2-2/+2
Change-Id: Ied3c6d1513f2181a5f7da2904a0df2f806146cec Reviewed-on: https://gerrit.libreoffice.org/51465 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-03-14tdf#116351: fix re-use of AttributeList on PGP manifesthimajin1000001-2/+2
multiple attributes of the same name on the same element, because AttributeList was wrongly re-used Change-Id: I29b2317ce3d836d7349fa0474709726bed2c5ad4 Reviewed-on: https://gerrit.libreoffice.org/51087 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-03-08oox: preserve the ContentType of custom filesAshod Nakashian1-2/+8
Generic logic to preserve custom files with their correct ContentType. Standard default file extensions with respective ContentType preserved in [Content_Types].xml. Change-Id: I651ed691e9a4745cd2cb4b3c4d4c5fd7287b66c2 Reviewed-on: https://gerrit.libreoffice.org/50856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-03-05drop sax::tools::*base64 methodsNoel Grandin2-12/+14
and use the underlying comphelper methods rather. This is so that I can break the dependency that tools has on sax, and can add methods that make sax depend on tools. Change-Id: I8a2d6ce2ffc3529a0020710ade6a1748ee5af7d5 Reviewed-on: https://gerrit.libreoffice.org/50767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-26loplugin:oncevar extend to tools/gen.hxx typesNoel Grandin1-3/+1
Change-Id: I5c75875da44334569c02e2ff039b33c38397a0a2 Reviewed-on: https://gerrit.libreoffice.org/50283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-23forcepoint #5 check for short readCaolán McNamara1-2/+5
a zip file within a structured storage stream. underlying storage stream claims larger size that it can satisfy on read Change-Id: I8516b12df33ad78b2525192826f5e3aef2622eb8 Reviewed-on: https://gerrit.libreoffice.org/50238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-14Fix typosAndrea Gelmini1-1/+1
Change-Id: Icee735b303ca72bba7b2680676b0c0092d27e2ec Reviewed-on: https://gerrit.libreoffice.org/49699 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-14oox: cosmetic cleanupAshod Nakashian2-10/+10
Change-Id: Ifafd7338ddfec8b707b5ddf4acb39512faf186da Reviewed-on: https://gerrit.libreoffice.org/49325 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-14ofopxml: always generate default application/xmlAshod Nakashian1-7/+14
MS Office always sets the application/xml entry but LO doesn't preserve unknown entries. Since this is a standard and always-set entry LO should always stamp it as well. Change-Id: I28b47634f2aa1fec233c9184deb65fd43f2f3ae8 Reviewed-on: https://gerrit.libreoffice.org/48724 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-07Prevent MemoryByteGrabber from ever taking temporaries againStephan Bergmann1-0/+2
...after c99527385acf367c748b3dcf3e6a3bb8103f5eee "MemoryByteGrabber sequence has to exist for Grabber lifetime" Change-Id: Idcb7548aaa7741e8e535024ba36c7a171a6c2fb4
2018-02-07MemoryByteGrabber sequence has to exist for Grabber lifetimeCaolán McNamara1-3/+5
it just takes a c++ ref, so a temp is an unsuitable arg Change-Id: I40490e94d977df91b985bc4ae458b68ee85d5dfe Reviewed-on: https://gerrit.libreoffice.org/49321 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-25loplugin:useuniqueptr in OInputCompStreamNoel Grandin2-4/+3
Change-Id: I49fb71aa4319f6ac245885535e8afe855113e162 Reviewed-on: https://gerrit.libreoffice.org/48557 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-19crashtesting: failure on import with bogus valuesCaolán McNamara1-1/+1
regression from... commit 7d8e94444d989d0ac4a4055b207726708e9ec0da Date: Thu Jan 11 08:47:15 2018 +0200 convert a<b?a:b to std::min(a,b) cause old promotion was to the largest type, so with a large 64bit nDiff and any 32bit nRequestedBytes the nRequestedBytes was promoted to 64bit, found to be smaller than nDiff, then would fit in 32bit. newer code cast both to 32bit, resulting in a negative nDiff which was smaller than nRequestedBytes, but going on to cause havoc. Change-Id: I9eb5c61302b3dccf5333c4dfbf9ac92ce49585b5 Reviewed-on: https://gerrit.libreoffice.org/48155 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin1-1/+1
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-13tdf#114550 don't use PBKDF2 in package for gpg encryptionThorsten Behrens7-9/+24
No need to derive password-based key, simply skip rtl_digest_PBKDF2 for the gpg4libre case. Also pass down PBKDF2 iteration count from ZipPackage, which knows about GPG encryption, instead of just always setting it in package stream. We otherwise needlessly iterate session key also for gpg encrypted storages. Change-Id: Ic96b2193f8541bbd109795fb9c0212a0a10c7344 Reviewed-on: https://gerrit.libreoffice.org/47783 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-13tdf#114550 recognize sym key & init vec as valid f/ decryptThorsten Behrens1-1/+4
Otherwise package code would _only_ try to decrypt for salt and iteration count present, which does not make sense for gpg. Change-Id: Ie366f086a3c14d6b54b91b4edee8cfef1a42c44b Reviewed-on: https://gerrit.libreoffice.org/47782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-13gpg4libre: open encrypted files also via gpgThorsten Behrens2-3/+56
Adds code to sfx2 and package to try gpg4libre for extracting session keys, and use them in turn to decrypt odf storage. Change-Id: I1f626143e6c8443b4ad0c4fc5bdbd5ab8d56a451 Reviewed-on: https://gerrit.libreoffice.org/47780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-13gpg4libre: import PGP encryption manifestThorsten Behrens2-1/+196
Change-Id: Iadd7f8f1194299cb50907d8594114c89c668ebd0 Reviewed-on: https://gerrit.libreoffice.org/46462 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-12tdf#114939 package: change ODF 1.1 export to use real SHA1Michael Stahl3-6/+6
Change-Id: I20d4965cc467df56536ca03b773b3f0f61b1f2a3
2018-01-12tdf#114939 package,comphelper: Try both real SHA1 and StarOffice SHA1Michael Stahl6-20/+111
... when importing ODF documents. In CreatePackageEncryptionData(), add a 3rd SHA1 password hash, PackageSHA1CorrectEncryptionKey, to EncryptionData. Use it in ZipPackageStream::getDataStream(), which has 3 fall-backs for SHA1 bugs now. Also add a CorrectSHA1DigestContext, to be used together with PackageSHA1CorrectEncryptionKey, and rename the existing one to StarOfficeSHA1DigestContext, to be used together with the existing 2 PackageSHA1{UTF8,MS1252}EncryptionKey. The fallback won't be used very often anyway: for the password SHA1 to be wrong, you need a password between 52 and 55 bytes long, and for the SHA1/1K checksum to be wrong, you need a file smaller than 1K with compressed size mod 64 between 52 and 55; all XML files have enough random "chaff" added to be too large. Test that we can read both correct SHA1 and StarOffice SHA1. Change-Id: I988fa489b5e40c7657f404f18538f637d54d28f1
2018-01-12More loplugin:cstylecast: packageStephan Bergmann3-4/+4
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0b588ac0743df25fd3eb3ac019fe6bd5360e5b0b
2018-01-12ODT export: handle NoFileSync store optionMiklos Vajna4-2/+14
SfxMedium already had a m_bDisableFileSync member; if the medium has a storage, then forward this flag to it, so at the end SwitchablePersistenceStream::waitForCompletion() (and the called fileaccess::XStream_impl::waitForCompletion()) does not call osl_syncFile(), either. Times for 100 hello world inputs: 12594 -> 5281 ms is spent in XHTML-load + ODT export + close (42% of original). Change-Id: I2aab6c9e6baf133b211620004dcea66bd41ffc6f Reviewed-on: https://gerrit.libreoffice.org/47766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-06tdf#114819 - include the synthetic encrpytion header into the size.Michael Meeks1-0/+1
Change-Id: I090347046725a1ebb7a36f465654c29f7443d20d Reviewed-on: https://gerrit.libreoffice.org/47467 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-12-27ofz#4806 Infinite loopCaolán McNamara1-2/+10
Change-Id: I89a24fa3ce4034ef207233b96c5e26a7b7787444 Reviewed-on: https://gerrit.libreoffice.org/47096 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-25ofz#4734 Null-derefCaolán McNamara1-2/+2
Change-Id: I9b0a5c1e14e95a686986975921f3adb769caad29 Reviewed-on: https://gerrit.libreoffice.org/47020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-14No need to keep these whitelisted functions decorated with SAL_CALLStephan Bergmann4-12/+12
The only effect SAL_CALL effectively has on LO-internal code is to change non- static member functions from __thiscall to __cdecl in MSVC (where all other functions are __cdecl by default, anyway). (For 3rd-party code, it could be argued that SAL_CALL is useful on function declarations in the URE stable interface other than non-static member functions, too, in case 3rd-party code uses a compiler switch to change the default calling convention to something other than __cdecl. But loplugin:salcall exempts the URE stable interface, anyway.) One could argue that SAL_CALL, even if today it effectively only affects non- static member functions in MSVC, could be extended in the future to affect more functions on more platforms. However, the current code would already not support that. For example, 3af500580b1c82eabd60335c9ebc458a3f68850c "loplugin:salcall fix functions" changed FrameControl_createInstance in UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even though its address (in ctl_component_getFacrory, in the same file) is passed to cppuhelper::createSingleFactory as an argument of type cppu::ComponentInstantiation, which is a pointer to SAL_CALL function. Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6 Reviewed-on: https://gerrit.libreoffice.org/46436 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-11Fix typos and grammarIlmari Lauhakangas1-1/+1
Change-Id: I4143da3c5a809118d57849664f6ab1d2e775837f Reviewed-on: https://gerrit.libreoffice.org/46253 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-11loplugin:salcall fix functionsNoel Grandin5-5/+5
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-10remove unused osl/time.h includes ..Jochen Nitschke3-3/+0
and some more in base64.cxx Change-Id: I31c9f23d3bd11f5482774e976a7c40025ffcfb86 Reviewed-on: https://gerrit.libreoffice.org/46157 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-08rtlRandomPool: remove pointless seeding with system timeThorsten Behrens1-4/+0
Change-Id: I88647a66a72d092303560a4348ce3dc55ee6c321 Reviewed-on: https://gerrit.libreoffice.org/46055 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-12-07gpg4libre: [API CHANGE] add storage helper for GPG encryption dataThorsten Behrens5-1/+87
OpenPGP encryption needs to pass down slightly different meta data to package / zip storage. Change-Id: Idba9ad7a821cb33070cf5e5a0f79ae55db99b276
2017-12-07gpg4libre: add manifest entries for gpg encryptionThorsten Behrens2-14/+174
Change-Id: I71bd7e2c6c73d997fa1ed5bb36fdc2873daca10c
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin13-38/+38
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05loplugin:countusersofdefaultparams in editeng..packageNoel Grandin2-4/+4
Change-Id: I4c20235a04d9ab5ea5edbb6b1b2413677b18a305 Reviewed-on: https://gerrit.libreoffice.org/45795 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-02ofz#4502 Direct-leakCaolán McNamara1-5/+9
Change-Id: I1323aa7033c68802384c9b984b52a6c6f1156094 Reviewed-on: https://gerrit.libreoffice.org/45714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-02improve scopingCaolán McNamara1-5/+3
Change-Id: I4b42d1357e951acda8e7cdba416dc298f260a541 Reviewed-on: https://gerrit.libreoffice.org/45713 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-02ofz#4491 Bad-CastCaolán McNamara1-3/+14
Change-Id: Ibee0c3e51ecd2b976d67c3ab28cabf0acb10c6b8 Reviewed-on: https://gerrit.libreoffice.org/45659 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-29ofz: Direct-leakCaolán McNamara1-5/+5
Change-Id: Id94586cc659a5e504c727c570dc9fc60c85c8820
2017-11-27keep track of available dataCaolán McNamara2-0/+5
Change-Id: Idc54cdef0f3a4355a7e26f25cdc5b50d65d9d583 Reviewed-on: https://gerrit.libreoffice.org/45351 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-24fix attempt to save and rethrow exceptionCaolán McNamara2-17/+7
Change-Id: Idff6ffef536d87d85f1092b3316d65da83527711 Reviewed-on: https://gerrit.libreoffice.org/45229 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>