You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2022/05/21 07:56:04 UTC

[openoffice] branch mp updated (759b5c48a3 -> e36edb0fc5)

This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a change to branch mp
in repository https://gitbox.apache.org/repos/asf/openoffice.git


 discard 759b5c48a3 Re-encode silently using the new encoding
 discard 41a4a68e58 Decode all data
     add da5310fc34 Fixed typos, removed whitespace
     add 4a763550f7 First code cleanup for removing Writer page shadows.
     add 448486c680 Implement a com.sun.star.logging.SyslogHandler service that logs to syslog.
     add eb1bbddb66 Updated English dictionary
     add 2bfabe857a Adjusting version number before cherry-picking it for AOO42X
     add e421cc8f5a Further code cleanup for removing Writer page shadows
     add 75e50e85ba Add space before number in untitled document.
     add 0ca5b4b7b8 Fix including OpenSSL dynamic libraries on Unix (#147)
     add 2967c86008 Cleaned up resource files, removed whitespace
     add fe4add9e1e Fix 75e50e85ba2d51b6b9e5adecdbf33c43a414edf2
     add 190f2c204c fixed testFind assertion text that was changed and caused the find and replace test to fail because it no longer worked with the bvt/find.odt test document.
     add daaa1af459 updated AOOTest.testHello to get the result first before the assertion and moved app.stop from tearDown into setup and afterClass due to screenshots happening after the app closed.
     add 118e126ca1 Merge pull request #148 from cbmarcum/test-work
     add 3be598994e Fixed typos, removed whitespace
     add 51ba086bf1 Port our WebDAV content provider from serf/apr/apr-util, to curl.
     add 19cdc44e34 Include string.h too, for memcpy().
     add 61a913b1ed Merge pull request #146 from DamjanJovanovic/serf2curl
     add bb956dfd85 Link to bundled OpenSSL if requested
     add 48c765a2ff Use > (<) instead of >> (<<)
     add 8fe0c17b03 Fixed typo, removed whitespace
     add c88f20dfb7 Removed whitespace
     new 59478b0400 Decode all data
     new 54e502a8ab Re-encode silently using the new encoding
     new e36edb0fc5 Generate IV's

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (759b5c48a3)
            \
             N -- N -- N   refs/heads/mp (e36edb0fc5)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch |   13 -
 ext_libraries/apr-util/apr-util-1.6.1.expat.patch  |   17 -
 .../apr-util/apr-util-1.6.1.makewin32.patch        |  199 --
 ext_libraries/apr-util/aprutil_version.mk          |   24 -
 ext_libraries/apr-util/makefile.mk                 |  139 --
 ext_libraries/apr-util/prj/build.lst               |    5 -
 ext_libraries/apr-util/prj/d.lst                   |   15 -
 ext_libraries/apr/apr-1.6.5-no-devenv.patch        |   16 -
 ext_libraries/apr/apr-1.6.5-windows.patch          |   11 -
 ext_libraries/apr/apr_version.mk                   |   24 -
 ext_libraries/apr/makefile.mk                      |  128 --
 ext_libraries/apr/prj/build.lst                    |    3 -
 ext_libraries/apr/prj/d.lst                        |   24 -
 ext_libraries/serf/NULbytes.patch                  |  313 ----
 ext_libraries/serf/makefile.mk                     |  134 --
 ext_libraries/serf/prj/build.lst                   |    3 -
 ext_libraries/serf/prj/d.lst                       |   12 -
 ext_libraries/serf/serf-1.2.1.ldl.patch            |   11 -
 ext_libraries/serf/serf-1.2.1.libs.patch           |   11 -
 ext_libraries/serf/serf-1.2.1.logging.patch        |   27 -
 ext_libraries/serf/serf_version.mk                 |   24 -
 ext_libraries/serf/win/Library_serf.mk             |   89 -
 ext_libraries/serf/win/Makefile                    |   30 -
 ext_libraries/serf/win/Module_serf.mk              |   27 -
 ext_libraries/serf/win/Package_inc.mk              |   27 -
 main/NOTICE                                        |    6 -
 main/RepositoryExternal.mk                         |  106 --
 main/configure.ac                                  |   82 +-
 main/curl/curl-bundled_openssl.patch               |   28 +
 main/curl/curl-wnt.patch                           |   38 +
 main/curl/makefile.mk                              |   25 +-
 main/curl/prj/build.lst                            |    2 +-
 main/extensions.lst                                |    2 +-
 main/extensions/source/logging/log.component       |    3 +
 main/extensions/source/logging/log_services.cxx    |    2 +
 main/extensions/source/logging/makefile.mk         |    1 +
 main/extensions/source/logging/sysloghandler.cxx   |  398 ++++
 main/external_deps.lst                             |   18 -
 main/offapi/UnoApi_offapi.mk                       |    1 +
 main/offapi/com/sun/star/logging/SyslogHandler.idl |   90 +
 .../registry/data/org/openoffice/Office/UI.xcu     |  111 +-
 .../org/openoffice/Office/UI/DrawWindowState.xcu   |  166 +-
 .../openoffice/Office/UI/ImpressWindowState.xcu    | 1630 ++++++++--------
 main/openssl/prj/d.lst                             |    4 +-
 main/scp2/prj/build.lst                            |    2 +-
 main/scp2/source/ooo/file_library_ooo.scp          |   72 +-
 main/scp2/source/ooo/makefile.mk                   |   25 +-
 main/scp2/source/ooo/shortcut_ooo.scp              |   47 -
 main/sd/source/filter/html/pubdlg.src              |    4 +-
 main/sd/source/ui/dlg/dlgass.src                   |    4 +-
 main/set_soenv.in                                  |    9 -
 main/sfx2/source/doc/objmisc.cxx                   |   63 +-
 main/svl/source/inc/passwordcontainer.hxx          |   15 +-
 .../source/passwordcontainer/passwordcontainer.cxx |   72 +-
 .../sdr/contact/viewcontactofsdrcaptionobj.cxx     |   98 +-
 .../sdr/contact/viewcontactofsdrmediaobj.cxx       |   26 +-
 .../svx/source/sdr/contact/viewcontactofsdrobj.cxx |   54 +-
 main/sw/source/core/inc/pagefrm.hxx                |   10 +-
 main/sw/source/core/layout/layact.cxx              |   35 +-
 main/sw/source/core/layout/paintfrm.cxx            |   55 +-
 main/sw/source/core/undo/undo.src                  |  144 +-
 main/sw/source/core/unocore/unocore.src            |   23 +-
 main/sw/source/core/view/pagepreviewlayout.cxx     |   21 +-
 main/sw/source/core/view/viewsh.cxx                |   49 +-
 main/sw/source/ui/smartmenu/stmenu.cxx             |  256 +--
 main/sw/source/ui/smartmenu/stmenu.hrc             |   13 +-
 main/ucb/Library_ucpdav1.mk                        |   34 +-
 main/ucb/prj/build.lst                             |    2 +-
 main/ucb/source/ucp/webdav/ContentProperties.cxx   |    4 +-
 .../{SerfInputStream.cxx => CurlInputStream.cxx}   |   40 +-
 .../{SerfInputStream.hxx => CurlInputStream.hxx}   |   15 +-
 .../{SerfLockStore.cxx => CurlLockStore.cxx}       |   50 +-
 .../{SerfLockStore.hxx => CurlLockStore.hxx}       |   38 +-
 main/ucb/source/ucp/webdav/CurlRequest.cxx         |  393 ++++
 main/ucb/source/ucp/webdav/CurlRequest.hxx         |  130 ++
 main/ucb/source/ucp/webdav/CurlSession.cxx         | 1959 ++++++++++++++++++++
 .../webdav/{SerfSession.hxx => CurlSession.hxx}    |  144 +-
 .../ucp/webdav/{SerfTypes.hxx => CurlTypes.hxx}    |   15 +-
 .../source/ucp/webdav/{SerfUri.cxx => CurlUri.cxx} |  174 +-
 .../source/ucp/webdav/{SerfUri.hxx => CurlUri.hxx} |   42 +-
 main/ucb/source/ucp/webdav/DAVProperties.cxx       |    6 +-
 main/ucb/source/ucp/webdav/DAVProperties.hxx       |    8 +-
 main/ucb/source/ucp/webdav/DAVResourceAccess.cxx   |   12 +-
 main/ucb/source/ucp/webdav/DAVResourceAccess.hxx   |    4 +-
 main/ucb/source/ucp/webdav/DAVSessionFactory.cxx   |   12 +-
 main/ucb/source/ucp/webdav/LockRequest.cxx         |   61 +
 .../ucp/webdav/{AprEnv.cxx => LockRequest.hxx}     |   42 +-
 main/ucb/source/ucp/webdav/PropfindRequest.cxx     |   81 +
 .../source/ucp/webdav/PropfindRequest.hxx}         |   34 +-
 main/ucb/source/ucp/webdav/ProppatchRequest.cxx    |  126 ++
 .../webdav/{AprEnv.hxx => ProppatchRequest.hxx}    |   35 +-
 main/ucb/source/ucp/webdav/SerfCallbacks.cxx       |  121 --
 main/ucb/source/ucp/webdav/SerfCallbacks.hxx       |   69 -
 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx |   91 -
 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx |   59 -
 .../source/ucp/webdav/SerfDeleteReqProcImpl.cxx    |   77 -
 .../source/ucp/webdav/SerfDeleteReqProcImpl.hxx    |   55 -
 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx  |  187 --
 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx  |   84 -
 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx |  141 --
 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx |   67 -
 .../source/ucp/webdav/SerfLockRefreshProcImpl.cxx  |   80 -
 .../source/ucp/webdav/SerfLockRefreshProcImpl.hxx  |   51 -
 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx |  155 --
 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx |   74 -
 .../ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx |   72 -
 .../ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx |   54 -
 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx |   91 -
 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx |   59 -
 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx |  136 --
 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx |   79 -
 .../source/ucp/webdav/SerfPropFindReqProcImpl.cxx  |  202 --
 .../source/ucp/webdav/SerfPropFindReqProcImpl.hxx  |   77 -
 .../source/ucp/webdav/SerfPropPatchReqProcImpl.cxx |  200 --
 .../source/ucp/webdav/SerfPropPatchReqProcImpl.hxx |   60 -
 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx  |   93 -
 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx  |   61 -
 .../ucb/source/ucp/webdav/SerfRequestProcessor.cxx |  721 -------
 .../ucb/source/ucp/webdav/SerfRequestProcessor.hxx |  208 ---
 .../source/ucp/webdav/SerfRequestProcessorImpl.cxx |  164 --
 .../source/ucp/webdav/SerfRequestProcessorImpl.hxx |   79 -
 .../ucp/webdav/SerfRequestProcessorImplFac.cxx     |  286 ---
 .../ucp/webdav/SerfRequestProcessorImplFac.hxx     |  142 --
 main/ucb/source/ucp/webdav/SerfSession.cxx         | 1708 -----------------
 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.cxx  |   92 -
 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.hxx  |   69 -
 main/ucb/source/ucp/webdav/webdavcontent.cxx       |   26 +-
 main/ucb/source/ucp/webdav/webdavdatasupplier.cxx  |   10 +-
 main/ucb/source/ucp/webdav/webdavprovider.cxx      |   21 +-
 main/vcl/source/control/lstbox.cxx                 |  664 +++----
 test/testgui/source/bvt/gui/BasicFunctionTest.java |    2 +-
 test/testgui/source/fvt/gui/AOOTest.java           |   36 +-
 132 files changed, 5533 insertions(+), 9787 deletions(-)
 delete mode 100644 ext_libraries/apr-util/apr-util-1.6.1.apu.hw.patch
 delete mode 100644 ext_libraries/apr-util/apr-util-1.6.1.expat.patch
 delete mode 100644 ext_libraries/apr-util/apr-util-1.6.1.makewin32.patch
 delete mode 100644 ext_libraries/apr-util/aprutil_version.mk
 delete mode 100644 ext_libraries/apr-util/makefile.mk
 delete mode 100644 ext_libraries/apr-util/prj/build.lst
 delete mode 100644 ext_libraries/apr-util/prj/d.lst
 delete mode 100644 ext_libraries/apr/apr-1.6.5-no-devenv.patch
 delete mode 100644 ext_libraries/apr/apr-1.6.5-windows.patch
 delete mode 100644 ext_libraries/apr/apr_version.mk
 delete mode 100644 ext_libraries/apr/makefile.mk
 delete mode 100644 ext_libraries/apr/prj/build.lst
 delete mode 100644 ext_libraries/apr/prj/d.lst
 delete mode 100644 ext_libraries/serf/NULbytes.patch
 delete mode 100644 ext_libraries/serf/makefile.mk
 delete mode 100644 ext_libraries/serf/prj/build.lst
 delete mode 100644 ext_libraries/serf/prj/d.lst
 delete mode 100644 ext_libraries/serf/serf-1.2.1.ldl.patch
 delete mode 100644 ext_libraries/serf/serf-1.2.1.libs.patch
 delete mode 100644 ext_libraries/serf/serf-1.2.1.logging.patch
 delete mode 100644 ext_libraries/serf/serf_version.mk
 delete mode 100755 ext_libraries/serf/win/Library_serf.mk
 delete mode 100755 ext_libraries/serf/win/Makefile
 delete mode 100755 ext_libraries/serf/win/Module_serf.mk
 delete mode 100755 ext_libraries/serf/win/Package_inc.mk
 create mode 100644 main/curl/curl-bundled_openssl.patch
 create mode 100644 main/curl/curl-wnt.patch
 create mode 100644 main/extensions/source/logging/sysloghandler.cxx
 create mode 100644 main/offapi/com/sun/star/logging/SyslogHandler.idl
 rename main/ucb/source/ucp/webdav/{SerfInputStream.cxx => CurlInputStream.cxx} (86%)
 rename main/ucb/source/ucp/webdav/{SerfInputStream.hxx => CurlInputStream.hxx} (93%)
 rename main/ucb/source/ucp/webdav/{SerfLockStore.cxx => CurlLockStore.cxx} (86%)
 rename main/ucb/source/ucp/webdav/{SerfLockStore.hxx => CurlLockStore.hxx} (71%)
 create mode 100644 main/ucb/source/ucp/webdav/CurlRequest.cxx
 create mode 100644 main/ucb/source/ucp/webdav/CurlRequest.hxx
 create mode 100644 main/ucb/source/ucp/webdav/CurlSession.cxx
 rename main/ucb/source/ucp/webdav/{SerfSession.hxx => CurlSession.hxx} (71%)
 rename main/ucb/source/ucp/webdav/{SerfTypes.hxx => CurlTypes.hxx} (86%)
 rename main/ucb/source/ucp/webdav/{SerfUri.cxx => CurlUri.cxx} (54%)
 rename main/ucb/source/ucp/webdav/{SerfUri.hxx => CurlUri.hxx} (76%)
 create mode 100644 main/ucb/source/ucp/webdav/LockRequest.cxx
 rename main/ucb/source/ucp/webdav/{AprEnv.cxx => LockRequest.hxx} (64%)
 create mode 100644 main/ucb/source/ucp/webdav/PropfindRequest.cxx
 copy main/{sw/source/ui/smartmenu/stmenu.hrc => ucb/source/ucp/webdav/PropfindRequest.hxx} (70%)
 create mode 100644 main/ucb/source/ucp/webdav/ProppatchRequest.cxx
 rename main/ucb/source/ucp/webdav/{AprEnv.hxx => ProppatchRequest.hxx} (70%)
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCallbacks.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCallbacks.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfGetReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfHeadReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockRefreshProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPostReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfPutReqProcImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImplFac.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfRequestProcessorImplFac.hxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfSession.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.cxx
 delete mode 100644 main/ucb/source/ucp/webdav/SerfUnlockProcImpl.hxx


[openoffice] 03/03: Generate IV's

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch mp
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit e36edb0fc5e0989ece97d1e29b0f10f08397a342
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Sat May 21 09:54:54 2022 +0200

    Generate IV's
---
 main/svl/source/inc/passwordcontainer.hxx          | 15 ++++-
 .../source/passwordcontainer/passwordcontainer.cxx | 72 +++++++++++++++++-----
 2 files changed, 68 insertions(+), 19 deletions(-)

diff --git a/main/svl/source/inc/passwordcontainer.hxx b/main/svl/source/inc/passwordcontainer.hxx
index 339f455ed9..3547f65d0e 100644
--- a/main/svl/source/inc/passwordcontainer.hxx
+++ b/main/svl/source/inc/passwordcontainer.hxx
@@ -304,6 +304,7 @@ bool createUrlRecord(
 
     /** Decode passwords on a line with the given master password.
      *
+     * @param aName name for the passwords. It can be a user name, for example.
      * @param aLine line with passwords to decode.
      * @param aMasterPassword master password to use.
      *
@@ -311,10 +312,20 @@ bool createUrlRecord(
      *
      * @return the decoded passwords.
      */
-    ::std::vector< ::rtl::OUString > DecodePasswords( const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPassword )
+    ::std::vector< ::rtl::OUString > DecodePasswords( const ::rtl::OUString& aName, const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPassword )
                                                         throw(::com::sun::star::uno::RuntimeException);
     
-    ::rtl::OUString EncodePasswords( ::std::vector< ::rtl::OUString > lines, const ::rtl::OUString& aMasterPassword )
+    /** Encode passwords on a line with the given master password.
+     *
+     * @param aName name for the passwords. It can be a user name, for example.
+     * @param lines lines with passwords to decode.
+     * @param aMasterPassword master password to use.
+     *
+     * The encoding is selected by mOldPasswordEncoding.
+     *
+     * @return the decoded passwords.
+     */
+    ::rtl::OUString EncodePasswords( const ::rtl::OUString& aName, ::std::vector< ::rtl::OUString > lines, const ::rtl::OUString& aMasterPassword )
                                                         throw(::com::sun::star::uno::RuntimeException);
 
     /** Actually change the master password, re-encoding all stored passwords.
diff --git a/main/svl/source/passwordcontainer/passwordcontainer.cxx b/main/svl/source/passwordcontainer/passwordcontainer.cxx
index 88f9083813..c95b3f1a82 100644
--- a/main/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/main/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -507,7 +507,24 @@ static void decodeMasterPassword(const ::rtl::OUString& aMasterPasswd,
 
 //-------------------------------------------------------------------------
 
-vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPasswd ) throw(RuntimeException)
+/** Prepare the IV.
+ *
+ * @param iv vector to prepare. Its contents are destroyed.
+ * @param masterPasswdCode master password as output from decodeMasterPassword.
+ * @param name name of the password to decrypt.
+ */
+static void prepareIV(std::vector<sal_uInt8>& iv, const unsigned char *masterPasswordCode, const ::rtl::OUString &aName) {
+    std::vector<sal_uInt8> ivSource;
+    ivSource.assign(masterPasswordCode, masterPasswordCode + RTL_DIGEST_LENGTH_MD5);
+    ::rtl::OString encodedName = ::rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8 );
+    ivSource.insert(ivSource.end(), encodedName.getStr(), encodedName.getStr() + encodedName.getLength());
+    iv.resize(RTL_DIGEST_LENGTH_MD5);
+    rtl_digest_MD5(ivSource.data(), ivSource.size(),
+                   iv.data(), iv.size());
+}
+
+//-------------------------------------------------------------------------
+vector< ::rtl::OUString > PasswordContainer::DecodePasswords(const ::rtl::OUString& aName, const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPasswd ) throw(RuntimeException)
 {
     if( aMasterPasswd.getLength() )
     {
@@ -516,13 +533,16 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
 
         if( aDecoder )
         {
+            std::vector<sal_uInt8> iv;
             unsigned char code[RTL_DIGEST_LENGTH_MD5];
             decodeMasterPassword(aMasterPasswd, code, mOldPasswordEncoding);
+            if (!mOldPasswordEncoding) {
+                prepareIV(iv, code, aName);
+            }
 
             rtlCipherError result = rtl_cipher_init (
                     aDecoder, rtl_Cipher_DirectionDecode,
-                    code, RTL_DIGEST_LENGTH_MD5, NULL, 0 );
-
+                    code, RTL_DIGEST_LENGTH_MD5, iv.data(), iv.size() );
             if( result == rtl_Cipher_E_None )
             {
                 ::rtl::ByteSequence aSeq = getBufFromAsciiLine( aLine );
@@ -556,7 +576,7 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
 
 //-------------------------------------------------------------------------
 
-::rtl::OUString PasswordContainer::EncodePasswords( vector< ::rtl::OUString > lines, const ::rtl::OUString& aMasterPasswd ) throw(RuntimeException)
+::rtl::OUString PasswordContainer::EncodePasswords( const ::rtl::OUString& aName, vector< ::rtl::OUString > lines, const ::rtl::OUString& aMasterPasswd ) throw(RuntimeException)
 {
     if( aMasterPasswd.getLength() )
     {
@@ -567,13 +587,16 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
 
         if( aEncoder )
         {
-
+            std::vector<sal_uInt8> iv;
             unsigned char code[RTL_DIGEST_LENGTH_MD5];
             decodeMasterPassword(aMasterPasswd, code, false);
+            if (!mOldPasswordEncoding) {
+                prepareIV(iv, code, aName);
+            }
 
             rtlCipherError result = rtl_cipher_init (
                     aEncoder, rtl_Cipher_DirectionEncode,
-                    code, RTL_DIGEST_LENGTH_MD5, NULL, 0 );
+                    code, RTL_DIGEST_LENGTH_MD5, iv.data(), iv.size() );
 
             if( result == rtl_Cipher_E_None )
             {
@@ -633,6 +656,15 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
 
 //-------------------------------------------------------------------------
 
+
+/** Return the "name" to use for the master password. */
+static const ::rtl::OUString& getMasterPasswordName(void) {
+    static const ::rtl::OUString value = ::rtl::OUString::createFromAscii( "Master" );
+    return value;
+}
+
+//-------------------------------------------------------------------------
+
 void PasswordContainer::doChangeMasterPassword(const ::rtl::OUString& aPass) {
     // get all the persistent entries if it is possible
     Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
@@ -643,7 +675,7 @@ void PasswordContainer::doChangeMasterPassword(const ::rtl::OUString& aPass) {
     // store the new master password
     m_aMasterPasswd = aPass;
     vector< ::rtl::OUString > aMaster( 1, m_aMasterPasswd );
-    m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, m_aMasterPasswd ) );
+    m_pStorageFile->setEncodedMP( EncodePasswords( getMasterPasswordName(), aMaster, m_aMasterPasswd ) );
 
     // store all the entries with the new password
     for ( int nURLInd = 0; nURLInd < aPersistent.getLength(); nURLInd++ )
@@ -700,7 +732,7 @@ UserRecord PasswordContainer::CopyToUserRecord( const NamePassRecord& aRecord, s
     {
         try
         {
-            ::std::vector< ::rtl::OUString > aDecodedPasswords = DecodePasswords( aRecord.GetPersPasswords(), GetMasterPassword( aHandler ) );
+            ::std::vector< ::rtl::OUString > aDecodedPasswords = DecodePasswords( aRecord.GetUserName(), aRecord.GetPersPasswords(), GetMasterPassword( aHandler ) );
             aPasswords.insert( aPasswords.end(), aDecodedPasswords.begin(), aDecodedPasswords.end() );
         }
         catch( NoMasterException& )
@@ -757,7 +789,7 @@ void PasswordContainer::PrivateAdd( const ::rtl::OUString& Url, const ::rtl::OUS
     ::std::vector< ::rtl::OUString > aStorePass = copySequenceToVector( Passwords );
 
     if( Mode == PERSISTENT_RECORD )
-        aRecord.SetPersPasswords( EncodePasswords( aStorePass, GetMasterPassword( aHandler ) ) );
+        aRecord.SetPersPasswords( EncodePasswords( aRecord.GetUserName(), aStorePass, GetMasterPassword( aHandler ) ) );
     else if( Mode == MEMORY_RECORD )
         aRecord.SetMemPasswords( aStorePass );
     else
@@ -974,20 +1006,26 @@ UrlRecord PasswordContainer::find(
                         m_aMasterPasswd = aPass;
                         vector< ::rtl::OUString > aMaster( 1, m_aMasterPasswd );
 
-                        m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, m_aMasterPasswd ) );
+                        m_pStorageFile->setEncodedMP( EncodePasswords( getMasterPasswordName(), aMaster, m_aMasterPasswd ) );
                     }
                     else
                     {
-                        vector< ::rtl::OUString > aRM( DecodePasswords( aEncodedMP, aPass ) );
+                        vector< ::rtl::OUString > aRM( DecodePasswords( getMasterPasswordName(), aEncodedMP, aPass ) );
                         if( !aRM.size() || !aPass.equals( aRM[0] ) )
                         {
                             // Try the old encoding
                             mOldPasswordEncoding = true;
-                            aRM = DecodePasswords( aEncodedMP, aPass );
-                            if (aRM.size() && aPass.equals(aRM[0])) {
-                                // Update the master password to the new encoding and update all stored passwords.
-                                m_aMasterPasswd = aPass;
-                                doChangeMasterPassword(aPass);
+                            try {
+                                aRM = DecodePasswords( getMasterPasswordName(), aEncodedMP, aPass );
+                                if (aRM.size() && aPass.equals(aRM[0])) {
+                                    // Update all passwords to the new encoding
+                                    m_aMasterPasswd = aPass;
+                                    doChangeMasterPassword(aPass);
+                                }
+                                mOldPasswordEncoding = false;
+                            } catch (...) {
+                                mOldPasswordEncoding = false;
+                                throw;
                             }
                         }
                         if( !aRM.size() || !aPass.equals( aRM[0] ) )
@@ -1156,7 +1194,7 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere
             {
                 sal_Int32 oldLen = aUsers.getLength();
                 aUsers.realloc( oldLen + 1 );
-                aUsers[ oldLen ] = UserRecord( aNPIter->GetUserName(), copyVectorToSequence( DecodePasswords( aNPIter->GetPersPasswords(), GetMasterPassword( xHandler ) ) ) );
+                aUsers[ oldLen ] = UserRecord( aNPIter->GetUserName(), copyVectorToSequence( DecodePasswords( aNPIter->GetUserName(), aNPIter->GetPersPasswords(), GetMasterPassword( xHandler ) ) ) );
             }
 
         if( aUsers.getLength() )


[openoffice] 01/03: Decode all data

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch mp
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 59478b04008290158f5d0a173ad609c8be16a13a
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Fri Mar 18 20:34:04 2022 +0100

    Decode all data
---
 .../source/passwordcontainer/passwordcontainer.cxx | 29 ++++++++++++++++------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/main/svl/source/passwordcontainer/passwordcontainer.cxx b/main/svl/source/passwordcontainer/passwordcontainer.cxx
index 572879de40..dba73730da 100644
--- a/main/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/main/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -481,6 +481,26 @@ void SAL_CALL PasswordContainer::disposing( const EventObject& ) throw(RuntimeEx
 
 //-------------------------------------------------------------------------
 
+/**
+ * @brief Decode a master password.
+ *
+ * @param aMasterPassword master password to decode.
+ * It must contain RTL_DIGEST_LENGTH_MD5 * 2 characters.
+ * @param code buffer to hold the decoded password.
+ * It must contain RTL_DIGEST_LENGTH_MD5 characters.
+ */
+static void decodeMasterPassword(const ::rtl::OUString& aMasterPasswd,
+                                 unsigned char *code)
+{
+    OSL_ENSURE( aMasterPasswd.getLength() == RTL_DIGEST_LENGTH_MD5 * 2, "Wrong master password format!\n" );
+    const sal_Unicode *aMasterBuf = aMasterPasswd.getStr();
+    for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
+        code[ ind ] = (char)((((aMasterBuf[ind * 2] - 'a') & 15) << 4) |
+                             ((aMasterBuf[ind * 2 + 1] - 'a') & 15));
+}
+
+//-------------------------------------------------------------------------
+
 vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPasswd ) throw(RuntimeException)
 {
     if( aMasterPasswd.getLength() )
@@ -490,11 +510,8 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
 
         if( aDecoder )
         {
-            OSL_ENSURE( aMasterPasswd.getLength() == RTL_DIGEST_LENGTH_MD5 * 2, "Wrong master password format!\n" );
-
             unsigned char code[RTL_DIGEST_LENGTH_MD5];
-            for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
-                code[ ind ] = (char)(aMasterPasswd.copy( ind*2, 2 ).toInt32(16));
+            decodeMasterPassword(aMasterPasswd, code);
 
             rtlCipherError result = rtl_cipher_init (
                     aDecoder, rtl_Cipher_DirectionDecode,
@@ -544,11 +561,9 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
 
         if( aEncoder )
         {
-            OSL_ENSURE( aMasterPasswd.getLength() == RTL_DIGEST_LENGTH_MD5 * 2, "Wrong master password format!\n" );
 
             unsigned char code[RTL_DIGEST_LENGTH_MD5];
-            for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
-                code[ ind ] = (char)(aMasterPasswd.copy( ind*2, 2 ).toInt32(16));
+            decodeMasterPassword(aMasterPasswd, code);
 
             rtlCipherError result = rtl_cipher_init (
                     aEncoder, rtl_Cipher_DirectionEncode,


[openoffice] 02/03: Re-encode silently using the new encoding

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch mp
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 54e502a8abaf3890ed309dcd191d96cf364c0751
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Sun Apr 17 14:14:17 2022 +0200

    Re-encode silently using the new encoding
---
 main/svl/source/inc/passwordcontainer.hxx          | 20 +++++-
 .../source/passwordcontainer/passwordcontainer.cxx | 77 ++++++++++++++--------
 2 files changed, 70 insertions(+), 27 deletions(-)

diff --git a/main/svl/source/inc/passwordcontainer.hxx b/main/svl/source/inc/passwordcontainer.hxx
index 5136b60f4f..339f455ed9 100644
--- a/main/svl/source/inc/passwordcontainer.hxx
+++ b/main/svl/source/inc/passwordcontainer.hxx
@@ -249,6 +249,8 @@ private:
     StorageItem* m_pStorageFile;
     ::osl::Mutex mMutex;
     ::rtl::OUString m_aMasterPasswd; // master password is set when the string is not empty
+    /// True if we detected the older password encoding (pre-4.1.13)
+    bool mOldPasswordEncoding;
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mComponent;
     SysCredentialsConfig mUrlContainer;
 
@@ -300,12 +302,28 @@ bool createUrlRecord(
                               const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler )
                                                         throw(::com::sun::star::uno::RuntimeException);
 
+    /** Decode passwords on a line with the given master password.
+     *
+     * @param aLine line with passwords to decode.
+     * @param aMasterPassword master password to use.
+     *
+     * The encoding is selected by mOldPasswordEncoding.
+     *
+     * @return the decoded passwords.
+     */
     ::std::vector< ::rtl::OUString > DecodePasswords( const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPassword )
                                                         throw(::com::sun::star::uno::RuntimeException);
     
     ::rtl::OUString EncodePasswords( ::std::vector< ::rtl::OUString > lines, const ::rtl::OUString& aMasterPassword )
                                                         throw(::com::sun::star::uno::RuntimeException);
-    
+
+    /** Actually change the master password, re-encoding all stored passwords.
+     *
+     * @param apass new password to set.
+     *
+     * Updates m_aMasterPasswd.
+     */
+    void doChangeMasterPassword(const ::rtl::OUString& aPass);
 public:
     PasswordContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
     ~PasswordContainer();
diff --git a/main/svl/source/passwordcontainer/passwordcontainer.cxx b/main/svl/source/passwordcontainer/passwordcontainer.cxx
index dba73730da..88f9083813 100644
--- a/main/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/main/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -427,7 +427,7 @@ void StorageItem::Commit()
 //-------------------------------------------------------------------------
 
 PasswordContainer::PasswordContainer( const Reference<XMultiServiceFactory>& xServiceFactory ):
-    m_pStorageFile( NULL )
+    m_pStorageFile( NULL ), mOldPasswordEncoding(false)
 {
     // m_pStorageFile->Notify() can be called
     ::osl::MutexGuard aGuard( mMutex );
@@ -488,15 +488,21 @@ void SAL_CALL PasswordContainer::disposing( const EventObject& ) throw(RuntimeEx
  * It must contain RTL_DIGEST_LENGTH_MD5 * 2 characters.
  * @param code buffer to hold the decoded password.
  * It must contain RTL_DIGEST_LENGTH_MD5 characters.
+ * @param oldEncoding use the encoding pre-AOO-4.1.12 if true
  */
 static void decodeMasterPassword(const ::rtl::OUString& aMasterPasswd,
-                                 unsigned char *code)
+                                 unsigned char *code, bool oldEncoding)
 {
     OSL_ENSURE( aMasterPasswd.getLength() == RTL_DIGEST_LENGTH_MD5 * 2, "Wrong master password format!\n" );
     const sal_Unicode *aMasterBuf = aMasterPasswd.getStr();
-    for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
-        code[ ind ] = (char)((((aMasterBuf[ind * 2] - 'a') & 15) << 4) |
-                             ((aMasterBuf[ind * 2 + 1] - 'a') & 15));
+    for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ ) {
+        if (!oldEncoding) {
+            code[ ind ] = (char)((((aMasterBuf[ind * 2] - 'a') & 15) << 4) |
+                                 ((aMasterBuf[ind * 2 + 1] - 'a') & 15));
+        } else {
+            code[ ind ] = (char)(aMasterPasswd.copy( ind*2, 2 ).toInt32(16));
+        }
+    }
 }
 
 //-------------------------------------------------------------------------
@@ -511,7 +517,7 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
         if( aDecoder )
         {
             unsigned char code[RTL_DIGEST_LENGTH_MD5];
-            decodeMasterPassword(aMasterPasswd, code);
+            decodeMasterPassword(aMasterPasswd, code, mOldPasswordEncoding);
 
             rtlCipherError result = rtl_cipher_init (
                     aDecoder, rtl_Cipher_DirectionDecode,
@@ -563,7 +569,7 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
         {
 
             unsigned char code[RTL_DIGEST_LENGTH_MD5];
-            decodeMasterPassword(aMasterPasswd, code);
+            decodeMasterPassword(aMasterPasswd, code, false);
 
             rtlCipherError result = rtl_cipher_init (
                     aEncoder, rtl_Cipher_DirectionEncode,
@@ -627,6 +633,29 @@ vector< ::rtl::OUString > PasswordContainer::DecodePasswords( const ::rtl::OUStr
 
 //-------------------------------------------------------------------------
 
+void PasswordContainer::doChangeMasterPassword(const ::rtl::OUString& aPass) {
+    // get all the persistent entries if it is possible
+    Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
+
+    // remove the master password and the entries persistence
+    removeMasterPassword();
+
+    // store the new master password
+    m_aMasterPasswd = aPass;
+    vector< ::rtl::OUString > aMaster( 1, m_aMasterPasswd );
+    m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, m_aMasterPasswd ) );
+
+    // store all the entries with the new password
+    for ( int nURLInd = 0; nURLInd < aPersistent.getLength(); nURLInd++ )
+        for ( int nNameInd = 0; nNameInd< aPersistent[nURLInd].UserList.getLength(); nNameInd++ )
+            addPersistent( aPersistent[nURLInd].Url,
+                           aPersistent[nURLInd].UserList[nNameInd].UserName,
+                           aPersistent[nURLInd].UserList[nNameInd].Passwords,
+                           uno::Reference< task::XInteractionHandler >() );
+}
+
+//-------------------------------------------------------------------------
+
 void PasswordContainer::UpdateVector( const ::rtl::OUString& aURL, list< NamePassRecord >& toUpdate, NamePassRecord& aRecord, sal_Bool writeFile ) throw(RuntimeException)
 {
     for( list< NamePassRecord >::iterator aNPIter = toUpdate.begin(); aNPIter != toUpdate.end(); aNPIter++ )
@@ -951,6 +980,17 @@ UrlRecord PasswordContainer::find(
                     {
                         vector< ::rtl::OUString > aRM( DecodePasswords( aEncodedMP, aPass ) );
                         if( !aRM.size() || !aPass.equals( aRM[0] ) )
+                        {
+                            // Try the old encoding
+                            mOldPasswordEncoding = true;
+                            aRM = DecodePasswords( aEncodedMP, aPass );
+                            if (aRM.size() && aPass.equals(aRM[0])) {
+                                // Update the master password to the new encoding and update all stored passwords.
+                                m_aMasterPasswd = aPass;
+                                doChangeMasterPassword(aPass);
+                            }
+                        }
+                        if( !aRM.size() || !aPass.equals( aRM[0] ) )
                         {
                             bAskAgain = sal_True;
                             aRMode = PasswordRequestMode_PASSWORD_REENTER;
@@ -1214,25 +1254,7 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference<
 
             if ( aPass.getLength() )
             {
-                // get all the persistent entries if it is possible
-                Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
-
-                // remove the master password and the entries persistence
-                removeMasterPassword();
-
-                // store the new master password
-                m_aMasterPasswd = aPass;
-                vector< ::rtl::OUString > aMaster( 1, m_aMasterPasswd );
-                m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, m_aMasterPasswd ) );
-
-                // store all the entries with the new password
-                for ( int nURLInd = 0; nURLInd < aPersistent.getLength(); nURLInd++ )
-                    for ( int nNameInd = 0; nNameInd< aPersistent[nURLInd].UserList.getLength(); nNameInd++ )
-                        addPersistent( aPersistent[nURLInd].Url,
-                                       aPersistent[nURLInd].UserList[nNameInd].UserName,
-                                       aPersistent[nURLInd].UserList[nNameInd].Passwords,
-                                       uno::Reference< task::XInteractionHandler >() );
-
+                doChangeMasterPassword(aPass);
                 bResult = sal_True;
             }
         }
@@ -1248,6 +1270,9 @@ void SAL_CALL PasswordContainer::removeMasterPassword()
     // remove all the stored passwords and the master password
     removeAllPersistent();
 
+    // Make sure we will not use the older encoding in the future
+    mOldPasswordEncoding = false;
+
     ::osl::MutexGuard aGuard( mMutex );
     if ( m_pStorageFile )
     {