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/04/17 12:16:40 UTC

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

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 4cf9e745f9 Decode all data
     add b56e71be0d Cleaned up resource files, removed whitespace
     add 229c356c86 Cleaned up resource files, removed whitespace
     add 3686b18d9f Updated rat excludes
     add 1dfc6c9463 Treat negative values correctly
     add 5ed3aded77 Cleaned up resource files, removed whitespace
     add afd5c4c039 Make 'Insert Rows/Insert Columns' better translatable by putting it in a single String
     add b3e637acb0 Cleanup for my last commit
     add ae79dcaa84 Cleaned up resource files, removed whitespace
     add d6197a3ee0 Updated English dictionary
     add 178b6841fb Cleaned up resource files, removed whitespace
     add f134535553 As of Python 3.8, the pkg-config "--libs" needed to build with Python, differ between Python modules and applications that embed Python (see https://bugs.python.org/issue36721).
     add d4eab93095 Cleaned up resource files, removed whitespace
     add bca24adc7c Fixed typo (panal -> panel), removed whitespace
     add 6469a73784 Cleaned up files, removed whitespace
     add 685ffcd161 Check sizes
     add 2f7f065d5d Fix compatibility with VS 2008
     add bdf8903e51 Cleaned up resource files, removed whitespace
     add 6ad462b038 Refs #i128459# - Initial work on removing dependencies on a build of office. updated smoketestdoc build where most of the dependencies were. Added a modified copy of main/solenv/ant/aoo-ant.xml to smoketestdoc for importing to build as well as idl.xml to import into aoo-ant.xml.
     add f420f94904 Refs #i128459# - added a path env needed for idlc, regmerge, and javamaker.
     add 1c0e347f36 Merge pull request #136 from cbmarcum/standalone-tests
     add 499ab82af0 Add README for using standalone automated tests (#137)
     add bc6c8f65f3 added prerequisites and windows platform examples. (#138)
     add e83be9d674 Refs #i128505# - testTableBorderLineStyle() was entering 0.55" instead of 0.50" at line 199 because the ctrl-a wasn't selecting all of the cell contents and leaving a 5 in the cell. then when typing in 0.5 it became 0.55 and failing the assertion at line 222. added sleep at 197 to make sure focus is completed before ctrl-a.
     add 709c58d0a8 Merge pull request #143 from cbmarcum/standalone-test-work
     add d99de66189 Refs #i128450# - disabled smb host only test per this email thread: https://lists.apache.org/thread/k1m3wqz04bj8b5kdg814h24qf45sv811 AOO keeps appending a final / thus changing the intent of the test.
     add f9405ed548 Merge pull request #144 from cbmarcum/standalone-test-work
     add e2666819d7 Merge pull request #145 from apache/standalone-test
     new 41a4a68e58 Decode all data
     new 759b5c48a3 Re-encode silently using the new encoding

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   (4cf9e745f9)
            \
             N -- N -- N   refs/heads/mp (759b5c48a3)

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 2 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:
 main/configure.ac                                  |    8 +-
 main/cui/source/dialogs/insrc.cxx                  |    6 +-
 main/cui/source/dialogs/insrc.src                  |   44 +-
 main/dbaccess/source/ui/dlg/AutoControls.src       |   43 +-
 main/dbaccess/source/ui/dlg/ConnectionPage.src     |  109 +-
 main/dbaccess/source/ui/dlg/UserAdminDlg.src       |   24 +-
 main/dbaccess/source/ui/dlg/dbadmin.src            |  603 ++++++-----
 main/dbaccess/source/ui/dlg/dsselect.src           |   54 +-
 main/editeng/source/editeng/editeng.src            |   23 +-
 main/editeng/source/items/page.src                 |   78 +-
 main/editeng/source/items/svxitems.src             |  197 ++--
 main/editeng/source/outliner/outliner.src          |   39 +-
 main/extensions.lst                                |    2 +-
 main/extensions/source/bibliography/datman.src     |  575 +++++-----
 main/extensions/source/bibliography/sections.src   |  521 ++++------
 main/extensions/source/bibliography/toolbar.src    |    1 -
 main/nss/makefile.mk                               |    1 +
 main/nss/nss_sizes.patch                           |  276 +++++
 main/rat-excludes                                  |    3 +
 main/svl/source/inc/passwordcontainer.hxx          |   20 +-
 .../source/passwordcontainer/passwordcontainer.cxx |   77 +-
 main/svx/source/dialog/fontwork.src                |  152 +--
 .../sidebar/text/TextCharacterSpacingControl.hxx   |   47 +-
 .../source/sidebar/text/TextUnderlineControl.cxx   |  250 ++---
 .../source/sidebar/text/TextUnderlineControl.hxx   |   27 +-
 .../svx/source/sidebar/text/TextUnderlinePopup.cxx |   32 +-
 .../svx/source/sidebar/text/TextUnderlinePopup.hxx |   24 +-
 main/sw/source/ui/config/optcomp.src               |  102 +-
 main/sw/source/ui/config/optdlg.src                | 1099 ++++++++++----------
 main/sw/source/ui/config/optload.src               |  355 +++----
 main/sw/source/ui/config/redlopt.src               |  280 +++--
 main/sw/source/ui/globdoc/globdoc.src              |   11 +-
 main/sw/source/ui/index/idxmrk.src                 |  698 ++++++-------
 main/sw/source/ui/misc/linenum.src                 |  182 ++--
 main/sw/source/ui/misc/outline.src                 |  158 ++-
 main/sw/source/ui/misc/pggrid.src                  |  301 +++---
 main/sw/source/ui/ribbar/workctrl.cxx              |    4 +-
 main/sw/source/ui/smartmenu/stmenu.src             |   28 +-
 main/sw/source/ui/uiview/pview.src                 |   45 +-
 main/sw/source/ui/uiview/view.src                  |   27 +-
 test/README.md                                     |  128 +++
 test/build.xml                                     |    1 +
 test/smoketestdoc/aoo-ant.xml                      |  243 +++++
 test/smoketestdoc/build.xml                        |   16 +-
 test/smoketestdoc/idl.xml                          |  132 +++
 .../prj/d.lst => test/smoketestdoc/manifest.empty  |    0
 .../source/fvt/gui/sw/hyperlink/WarningDialog.java |    7 +-
 .../source/fvt/gui/sw/table/TableGeneral.java      |    1 +
 48 files changed, 3810 insertions(+), 3244 deletions(-)
 create mode 100644 main/nss/nss_sizes.patch
 create mode 100644 test/README.md
 create mode 100644 test/smoketestdoc/aoo-ant.xml
 create mode 100644 test/smoketestdoc/idl.xml
 copy ext_libraries/ratscan/prj/d.lst => test/smoketestdoc/manifest.empty (100%)


[openoffice] 01/02: 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 41a4a68e58902d88628b649dd194f4f1cd757eeb
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/02: 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 759b5c48a3b9bd2d76487d6dae8aa5418c480867
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 )
     {