[Libreoffice-commits] core.git: 2 commits - cui/source download.lst external/openssl

Caolán McNamara caolanm at redhat.com
Tue Apr 8 04:19:54 PDT 2014


 cui/source/inc/cuitabarea.hxx               |    2 
 cui/source/tabpages/tpcolor.cxx             |  132 ++++++++++------------------
 download.lst                                |    2 
 external/openssl/CVE-2014-0160.patch        |  108 ----------------------
 external/openssl/UnpackedTarball_openssl.mk |    1 
 5 files changed, 50 insertions(+), 195 deletions(-)

New commits:
commit ccd048fa17a206d7ac57d3a888d0181ad2ea1e7c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 8 12:17:09 2014 +0100

    bump to openssl-1.0.1g
    
    Change-Id: I1e0ee6aa3d136c75309c5c70011da787806efa1f

diff --git a/download.lst b/download.lst
index 09b64ac..62ea866 100644
--- a/download.lst
+++ b/download.lst
@@ -98,7 +98,7 @@ export MYTHES_TARBALL := 46e92b68e31e858512b680b3b61dc4c1-mythes-1.2.3.tar.gz
 export NEON_TARBALL := ff369e69ef0f0143beb5626164e87ae2-neon-0.29.5.tar.gz
 export NSS_TARBALL := 06beb053e257d9e22641339c905c6eba-nss-3.15.3-with-nspr-4.10.2.tar.gz
 export OPENLDAP_TARBALL := 804c6cb5698db30b75ad0ff1c25baefd-openldap-2.4.31.tgz
-export OPENSSL_TARBALL := 66bf6f10f060d561929de96f9dfe5b8c-openssl-1.0.1e.tar.gz
+export OPENSSL_TARBALL := de62b43dfcd858e66a74bee1c834e959-openssl-1.0.1g.tar.gz
 export ORCUS_TARBALL := 7681383be6ce489d84c1c74f4e7f9643-liborcus-0.7.0.tar.bz2
 export PIXMAN_TARBALL := c63f411b3ad147db2bcce1bf262a0e02-pixman-0.24.4.tar.bz2
 export PNG_TARBALL := 9e5d864bce8f06751bbd99962ecf4aad-libpng-1.5.10.tar.gz
diff --git a/external/openssl/CVE-2014-0160.patch b/external/openssl/CVE-2014-0160.patch
deleted file mode 100644
index ddf9d9c..0000000
--- a/external/openssl/CVE-2014-0160.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From: Dr. Stephen Henson <steve at openssl.org>
-Date: Sat, 5 Apr 2014 23:51:06 +0000 (+0100)
-Subject: Add heartbeat extension bounds check.
-X-Git-Tag: OpenSSL_1_0_1g~3
-X-Git-Url: http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=96db902
-
-Add heartbeat extension bounds check.
-
-A missing bounds check in the handling of the TLS heartbeat extension
-can be used to reveal up to 64k of memory to a connected client or
-server.
-
-Thanks for Neel Mehta of Google Security for discovering this bug and to
-Adam Langley <agl at chromium.org> and Bodo Moeller <bmoeller at acm.org> for
-preparing the fix (CVE-2014-0160)
----
-
-diff --git a/a/ssl/d1_both.c b/ssl/d1_both.c
-index 7a5596a..2e8cf68 100644
---- a/a/ssl/d1_both.c
-+++ a/b/ssl/d1_both.c
-@@ -1459,26 +1459,36 @@ dtls1_process_heartbeat(SSL *s)
- 	unsigned int payload;
- 	unsigned int padding = 16; /* Use minimum padding */
- 
--	/* Read type and payload length first */
--	hbtype = *p++;
--	n2s(p, payload);
--	pl = p;
--
- 	if (s->msg_callback)
- 		s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT,
- 			&s->s3->rrec.data[0], s->s3->rrec.length,
- 			s, s->msg_callback_arg);
- 
-+	/* Read type and payload length first */
-+	if (1 + 2 + 16 > s->s3->rrec.length)
-+		return 0; /* silently discard */
-+	hbtype = *p++;
-+	n2s(p, payload);
-+	if (1 + 2 + payload + 16 > s->s3->rrec.length)
-+		return 0; /* silently discard per RFC 6520 sec. 4 */
-+	pl = p;
-+
- 	if (hbtype == TLS1_HB_REQUEST)
- 		{
- 		unsigned char *buffer, *bp;
-+		unsigned int write_length = 1 /* heartbeat type */ +
-+					    2 /* heartbeat length */ +
-+					    payload + padding;
- 		int r;
- 
-+		if (write_length > SSL3_RT_MAX_PLAIN_LENGTH)
-+			return 0;
-+
- 		/* Allocate memory for the response, size is 1 byte
- 		 * message type, plus 2 bytes payload length, plus
- 		 * payload, plus padding
- 		 */
--		buffer = OPENSSL_malloc(1 + 2 + payload + padding);
-+		buffer = OPENSSL_malloc(write_length);
- 		bp = buffer;
- 
- 		/* Enter response type, length and copy payload */
-@@ -1489,11 +1499,11 @@ dtls1_process_heartbeat(SSL *s)
- 		/* Random padding */
- 		RAND_pseudo_bytes(bp, padding);
- 
--		r = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, 3 + payload + padding);
-+		r = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, write_length);
- 
- 		if (r >= 0 && s->msg_callback)
- 			s->msg_callback(1, s->version, TLS1_RT_HEARTBEAT,
--				buffer, 3 + payload + padding,
-+				buffer, write_length,
- 				s, s->msg_callback_arg);
- 
- 		OPENSSL_free(buffer);
-diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
-index b82fada..bddffd9 100644
---- a/a/ssl/t1_lib.c
-+++ a/b/ssl/t1_lib.c
-@@ -2588,16 +2588,20 @@ tls1_process_heartbeat(SSL *s)
- 	unsigned int payload;
- 	unsigned int padding = 16; /* Use minimum padding */
- 
--	/* Read type and payload length first */
--	hbtype = *p++;
--	n2s(p, payload);
--	pl = p;
--
- 	if (s->msg_callback)
- 		s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT,
- 			&s->s3->rrec.data[0], s->s3->rrec.length,
- 			s, s->msg_callback_arg);
- 
-+	/* Read type and payload length first */
-+	if (1 + 2 + 16 > s->s3->rrec.length)
-+		return 0; /* silently discard */
-+	hbtype = *p++;
-+	n2s(p, payload);
-+	if (1 + 2 + payload + 16 > s->s3->rrec.length)
-+		return 0; /* silently discard per RFC 6520 sec. 4 */
-+	pl = p;
-+
- 	if (hbtype == TLS1_HB_REQUEST)
- 		{
- 		unsigned char *buffer, *bp;
diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk
index 869a74e..cec09d2 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -91,7 +91,6 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,openssl,\
 ))
 
 $(eval $(call gb_UnpackedTarball_add_patches,openssl,\
-	external/openssl/CVE-2014-0160.patch \
 	$(if $(filter LINUX FREEBSD ANDROID,$(OS)),external/openssl/openssllnx.patch) \
 	$(if $(filter WNTGCC,$(OS)$(COM)),external/openssl/opensslmingw.patch) \
 	$(if $(filter MSC,$(COM)),external/openssl/opensslwnt.patch) \
commit a3416803959b2eb472d5946cbeb8048582f83123
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 8 09:30:16 2014 +0100

    Resolves: fdo#54024 color values not showing with custom colors
    
    that are unknown in the palette
    
    Change-Id: Icb80ad0d16f0315e21c14e748e91f505edd699c3

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 34e9366..417b89a 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -722,7 +722,7 @@ private:
     DECL_LINK( SelectColorLBHdl_Impl, void * );
     DECL_LINK( SelectValSetHdl_Impl, void * );
     DECL_LINK( SelectColorModelHdl_Impl, void * );
-    long ChangeColorHdl_Impl( void* p );
+    void ChangeColor(const Color &rNewColor);
     DECL_LINK( ModifiedHdl_Impl, void * );
 
     long CheckChanges_Impl();
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index b9bef98..5e28dbb 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -264,7 +264,12 @@ void SvxColorTabPage::Update(bool bLoaded)
         else
             m_pLbColor->SelectEntryPos( m_pLbColor->GetSelectEntryPos() );
 
-        ChangeColorHdl_Impl( this );
+        sal_Int32 nPos = m_pLbColor->GetSelectEntryPos();
+        if( nPos != LISTBOX_ENTRY_NOTFOUND )
+        {
+            XColorEntry* pEntry = pColorList->GetColor( nPos );
+            ChangeColor(pEntry->GetColor());
+        }
         SelectColorLBHdl_Impl( this );
     }
 
@@ -431,8 +436,8 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
                 m_pLbColor->SelectEntryPos( *pPos );
                 m_pValSetColorList->SelectItem( m_pLbColor->GetSelectEntryPos() + 1 );
                 m_pEdtName->SetText( m_pLbColor->GetSelectEntry() );
-
-                ChangeColorHdl_Impl( this );
+                XColorEntry* pEntry = pColorList->GetColor( *pPos );
+                ChangeColor(pEntry->GetColor());
             }
             else if( *pPageType == PT_COLOR && *pPos == LISTBOX_ENTRY_NOTFOUND )
             {
@@ -441,7 +446,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
                 {
                     m_pLbColorModel->SelectEntryPos( CM_RGB );
 
-                    aCurrentColor.SetColor ( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue().GetColor() );
+                    ChangeColor(((const XFillColorItem*)pPoolItem)->GetColorValue());
 
                     m_pEdtName->SetText( ( ( const XFillColorItem* ) pPoolItem )->GetName() );
 
@@ -488,11 +493,6 @@ int SvxColorTabPage::DeactivatePage( SfxItemSet* _pSet )
 long SvxColorTabPage::CheckChanges_Impl()
 {
     // used to NOT lose changes
-
-    Color aTmpColor (aCurrentColor);
-    if (eCM != CM_RGB)
-        ConvertColorValues (aTmpColor, CM_RGB);
-
     sal_Int32 nPos = m_pLbColor->GetSelectEntryPos();
     if( nPos != LISTBOX_ENTRY_NOTFOUND )
     {
@@ -502,9 +502,9 @@ long SvxColorTabPage::CheckChanges_Impl()
         // aNewColor, because COL_USER != COL_something, even if RGB values are the same
         // Color aNewColor( aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue() );
 
-        if( ColorToPercent_Impl( aTmpColor.GetRed() ) != ColorToPercent_Impl( aColor.GetRed() ) ||
-            ColorToPercent_Impl( aTmpColor.GetGreen() ) != ColorToPercent_Impl( aColor.GetGreen() ) ||
-            ColorToPercent_Impl( aTmpColor.GetBlue() ) != ColorToPercent_Impl( aColor.GetBlue() ) ||
+        if( ColorToPercent_Impl( aCurrentColor.GetRed() ) != ColorToPercent_Impl( aColor.GetRed() ) ||
+            ColorToPercent_Impl( aCurrentColor.GetGreen() ) != ColorToPercent_Impl( aColor.GetGreen() ) ||
+            ColorToPercent_Impl( aCurrentColor.GetBlue() ) != ColorToPercent_Impl( aColor.GetBlue() ) ||
             aString != m_pEdtName->GetText() )
         {
             ResMgr& rMgr = CUI_MGR();
@@ -573,8 +573,6 @@ bool SvxColorTabPage::FillItemSet( SfxItemSet& rSet )
         else
         {
             aColor.SetColor (aCurrentColor.GetColor());
-            if (eCM != CM_RGB)
-                ConvertColorValues (aColor, CM_RGB);
         }
         rSet.Put( XFillColorItem( aString, aColor ) );
         rSet.Put( XFillStyleItem( XFILL_SOLID ) );
@@ -598,10 +596,13 @@ void SvxColorTabPage::Reset( const SfxItemSet& rSet )
 {
     sal_uInt16 nState = rSet.GetItemState( XATTR_FILLCOLOR );
 
+    Color aNewColor;
+
     if ( nState >= SFX_ITEM_DEFAULT )
     {
         XFillColorItem aColorItem( (const XFillColorItem&)rSet.Get( XATTR_FILLCOLOR ) );
-        m_pLbColor->SelectEntry( aColorItem.GetColorValue() );
+        aNewColor = aColorItem.GetColorValue();
+        m_pLbColor->SelectEntry(aNewColor);
         m_pValSetColorList->SelectItem( m_pLbColor->GetSelectEntryPos() + 1 );
         m_pEdtName->SetText( m_pLbColor->GetSelectEntry() );
     }
@@ -610,7 +611,7 @@ void SvxColorTabPage::Reset( const SfxItemSet& rSet )
     OUString aStr = GetUserData();
     m_pLbColorModel->SelectEntryPos( aStr.toInt32() );
 
-    ChangeColorHdl_Impl( this );
+    ChangeColor(aNewColor);
     SelectColorModelHdl_Impl( this );
 
     m_pCtlPreviewOld->Invalidate();
@@ -625,11 +626,7 @@ SfxTabPage* SvxColorTabPage::Create( Window* pWindow,
     return( new SvxColorTabPage( pWindow, rOutAttrs ) );
 }
 
-
-
-
 // is called when the content of the MtrFields is changed for color values
-
 IMPL_LINK_NOARG(SvxColorTabPage, ModifiedHdl_Impl)
 {
     if (eCM == CM_RGB)
@@ -646,14 +643,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ModifiedHdl_Impl)
                                         (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pC->GetValue() ),
                                         (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pY->GetValue() ),
                                         (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pM->GetValue() ) ).GetColor() );
+        ConvertColorValues (aCurrentColor, CM_RGB);
     }
 
-    Color aTmpColor(aCurrentColor);
-
-    if (eCM != CM_RGB)
-        ConvertColorValues (aTmpColor, CM_RGB);
-
-    rXFSet.Put( XFillColorItem( OUString(), aTmpColor ) );
+    rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
     m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
 
     m_pCtlPreviewNew->Invalidate();
@@ -717,8 +710,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
     // if not existing the entry is entered
     if( bDifferent )
     {
-        if (eCM != CM_RGB)
-            ConvertColorValues (aCurrentColor, CM_RGB);
         pEntry = new XColorEntry( aCurrentColor, aName );
 
         pColorList->Insert( pEntry, pColorList->Count() );
@@ -789,13 +780,8 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
         // if not existing the entry is entered
         if( bDifferent )
         {
-            Color aTmpColor (aCurrentColor);
-
-            if (eCM != CM_RGB)
-                ConvertColorValues (aTmpColor, CM_RGB);
-
             // #123497# Need to replace the existing entry with a new one (old returned needs to be deleted)
-            XColorEntry* pEntry = new XColorEntry(aTmpColor, aName);
+            XColorEntry* pEntry = new XColorEntry(aCurrentColor, aName);
             delete pColorList->Replace(pEntry, nPos);
 
             m_pLbColor->Modify( *pEntry, nPos );
@@ -819,11 +805,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl)
 {
     SvColorDialog* pColorDlg = new SvColorDialog( GetParentDialog() );
 
-    Color aTmpColor (aCurrentColor);
-    if (eCM != CM_RGB)
-        ConvertColorValues (aTmpColor, CM_RGB);
-
-    pColorDlg->SetColor (aTmpColor);
+    pColorDlg->SetColor (aCurrentColor);
     pColorDlg->SetMode( svtools::ColorPickerMode_MODIFY );
 
     if( pColorDlg->Execute() == RET_OK )
@@ -838,6 +820,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl)
             m_pY->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
             m_pM->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
             m_pK->SetValue( ColorToPercent_Impl( nK ) );
+            ConvertColorValues (aCurrentColor, CM_RGB);
         }
         else
         {
@@ -913,7 +896,8 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorLBHdl_Impl)
         m_pCtlPreviewOld->Invalidate();
         m_pCtlPreviewNew->Invalidate();
 
-        ChangeColorHdl_Impl( this );
+        XColorEntry* pEntry = pColorList->GetColor(nPos);
+        ChangeColor(pEntry->GetColor());
     }
     return 0;
 }
@@ -936,7 +920,8 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectValSetHdl_Impl)
         m_pCtlPreviewOld->Invalidate();
         m_pCtlPreviewNew->Invalidate();
 
-        ChangeColorHdl_Impl( this );
+        XColorEntry* pEntry = pColorList->GetColor(nPos-1);
+        ChangeColor(pEntry->GetColor());
     }
     return 0;
 }
@@ -969,11 +954,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl)
     int nPos = m_pLbColorModel->GetSelectEntryPos();
     if( nPos != LISTBOX_ENTRY_NOTFOUND )
     {
-        if (eCM != (ColorModel) nPos)
-        {
-            ConvertColorValues (aCurrentColor, (ColorModel) nPos);
-        }
-
         eCM = (ColorModel) nPos;
 
         switch( eCM )
@@ -983,10 +963,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl)
                 m_pRGB->Show();
                 m_pCMYK->Hide();
 
-                m_pR->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
-                m_pG->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
-                m_pB->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
-
             }
             break;
 
@@ -994,17 +970,11 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl)
             {
                 m_pCMYK->Show();
                 m_pRGB->Hide();
-
-                m_pC->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
-                m_pY->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
-                m_pM->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
-                m_pK->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
-
             }
             break;
         }
 
-        ChangeColorHdl_Impl( this );
+        ChangeColor(aCurrentColor);
 
     }
 
@@ -1013,37 +983,31 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl)
 
 
 
-long SvxColorTabPage::ChangeColorHdl_Impl( void* )
+void SvxColorTabPage::ChangeColor(const Color &rNewColor)
 {
-    int nPos = m_pLbColor->GetSelectEntryPos();
-    if( nPos != LISTBOX_ENTRY_NOTFOUND )
+    aCurrentColor = rNewColor;
+    if (eCM != CM_RGB)
     {
-        XColorEntry* pEntry = pColorList->GetColor( nPos );
-
-        aCurrentColor.SetColor ( pEntry->GetColor().GetColor() );
-        if (eCM != CM_RGB)
-        {
-            ConvertColorValues (aCurrentColor, eCM);
-            m_pC->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
-            m_pY->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
-            m_pM->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
-            m_pK->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
-        }
-        else
-        {
-            m_pR->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
-            m_pG->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
-            m_pB->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
-        }
+        ConvertColorValues (aCurrentColor, eCM);
+        m_pC->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
+        m_pY->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
+        m_pM->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
+        m_pK->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
+        ConvertColorValues (aCurrentColor, CM_RGB);
+    }
+    else
+    {
+        m_pR->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
+        m_pG->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
+        m_pB->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
+    }
 
-        // fill ItemSet and pass it on to XOut
-        rXFSet.Put( XFillColorItem( OUString(), pEntry->GetColor() ) );
-        m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
-        m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
+    // fill ItemSet and pass it on to XOut
+    rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
+    m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
+    m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() );
 
-        m_pCtlPreviewNew->Invalidate();
-    }
-    return 0;
+    m_pCtlPreviewNew->Invalidate();
 }
 
 


More information about the Libreoffice-commits mailing list