aboutsummaryrefslogtreecommitdiffstats
path: root/editors/openoffice-4
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2018-10-16 01:27:41 +0800
committertruckman <truckman@FreeBSD.org>2018-10-16 01:27:41 +0800
commitfca8c48f7e9cdf39ddf3805da50e2ca7fb06bfec (patch)
treeaa8ab938c4d49dc8a094d6a83bf9da0f5206b518 /editors/openoffice-4
parentadab06c0c6641493b4f1237ef72a801c4e3f499d (diff)
downloadfreebsd-ports-gnome-fca8c48f7e9cdf39ddf3805da50e2ca7fb06bfec.tar.gz
freebsd-ports-gnome-fca8c48f7e9cdf39ddf3805da50e2ca7fb06bfec.tar.zst
freebsd-ports-gnome-fca8c48f7e9cdf39ddf3805da50e2ca7fb06bfec.zip
editors/openoffice-4, editors/openoffice-devel:
Fix build with OpenSSL 1.1.x Pet portlint (USES block location) PR: 232265 Reported by: pkg-fallout
Diffstat (limited to 'editors/openoffice-4')
-rw-r--r--editors/openoffice-4/Makefile31
-rw-r--r--editors/openoffice-4/files/patch-oox_source_core_filterdetect.cxx95
2 files changed, 111 insertions, 15 deletions
diff --git a/editors/openoffice-4/Makefile b/editors/openoffice-4/Makefile
index 8d195f698bcf..ee945d0bd067 100644
--- a/editors/openoffice-4/Makefile
+++ b/editors/openoffice-4/Makefile
@@ -3,7 +3,7 @@
PORTNAME= apache-openoffice
PORTVERSION= ${AOOVERSION}
-PORTREVISION= 9
+PORTREVISION= 10
CATEGORIES= editors java
MASTER_SITES= APACHE/openoffice/${PORTVERSION}/sources \
http://tools.openoffice.org/unowinreg_prebuild/680/:unoreg \
@@ -96,6 +96,21 @@ RUN_DEPENDS= \
${LOCALBASE}/share/fonts/Carlito/Carlito-Bold.ttf:x11-fonts/crosextrafonts-carlito-ttf \
${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf:x11-fonts/croscorefonts-fonts-ttf
+USES= autoreconf bison compiler:c++11-lib cpe \
+ desktop-file-utils \
+ gettext-runtime gmake iconv jpeg perl5 pkgconfig python:2.7 \
+ shared-mime-info ssl tar:bzip2
+USE_GL= gl glu
+USE_GNOME= gtk20 libxslt libidl glib20
+USE_JAVA= yes
+JAVA_BUILD= jdk
+JAVA_RUN= jdk
+JAVA_VENDOR= openjdk
+JAVA_VERSION= 1.6+
+USE_PERL5= build
+USE_XORG= ice sm x11 xau xaw xcomposite xcursor xdamage xext xfixes xi \
+ xinerama xrandr xrender xt
+
CONFLICTS_INSTALL= apache-openoffice-devel-*
AOOVERSION1= 4
@@ -119,20 +134,6 @@ XDGDIR= ${OOPATH}/share/xdg
XDGREL= ../../${INSTALLATION_BASEDIR}/openoffice${AOOVERSION1}/share/xdg
EXECBASE?= openoffice-${AOOSUFFIX}
-USES= autoreconf bison compiler:c++11-lib cpe \
- desktop-file-utils \
- gettext-runtime gmake iconv jpeg perl5 pkgconfig python:2.7 \
- shared-mime-info ssl tar:bzip2
-USE_GL= gl glu
-USE_GNOME= gtk20 libxslt libidl glib20
-USE_JAVA= yes
-JAVA_BUILD= jdk
-JAVA_RUN= jdk
-JAVA_VENDOR= openjdk
-JAVA_VERSION= 1.6+
-USE_PERL5= build
-USE_XORG= ice sm x11 xau xaw xcomposite xcursor xdamage xext xfixes xi \
- xinerama xrandr xrender xt
INSTALLS_ICONS= yes
WITHOUT_CPU_CFLAGS= true
CPE_PRODUCT= ${PORTNAME:S|apache-||}
diff --git a/editors/openoffice-4/files/patch-oox_source_core_filterdetect.cxx b/editors/openoffice-4/files/patch-oox_source_core_filterdetect.cxx
new file mode 100644
index 000000000000..1d515050e31f
--- /dev/null
+++ b/editors/openoffice-4/files/patch-oox_source_core_filterdetect.cxx
@@ -0,0 +1,95 @@
+--- oox/source/core/filterdetect.cxx.orig 2017-11-27 13:44:08 UTC
++++ oox/source/core/filterdetect.cxx
+@@ -26,6 +26,7 @@
+ #include <com/sun/star/io/XStream.hpp>
+ #include <comphelper/docpasswordhelper.hxx>
+ #include <comphelper/mediadescriptor.hxx>
++#include <openssl/opensslv.h>
+ #include <openssl/evp.h>
+ #include <rtl/digest.h>
+ #include "oox/core/fastparser.hxx"
+@@ -355,25 +356,39 @@ bool lclCheckEncryptionData( const sal_uInt8* pnKey, s
+ if ( nKeySize == 16 && nVerifierSize == 16 && nVerifierHashSize == 32 )
+ {
+ // check password
++ EVP_CIPHER_CTX *pAes_ctx;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX aes_ctx;
+ EVP_CIPHER_CTX_init( &aes_ctx );
+- EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
+- EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
++ pAes_ctx = &aes_ctx;
++#else
++ pAes_ctx = EVP_CIPHER_CTX_new();
++#endif
++ EVP_DecryptInit_ex( pAes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
++ EVP_CIPHER_CTX_set_padding( pAes_ctx, 0 );
+ int nOutLen = 0;
+ sal_uInt8 pnTmpVerifier[ 16 ];
+ (void) memset( pnTmpVerifier, 0, sizeof(pnTmpVerifier) );
+
+- /*int*/ EVP_DecryptUpdate( &aes_ctx, pnTmpVerifier, &nOutLen, pnVerifier, nVerifierSize );
++ /*int*/ EVP_DecryptUpdate( pAes_ctx, pnTmpVerifier, &nOutLen, pnVerifier, nVerifierSize );
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_cleanup( &aes_ctx );
+
+ EVP_CIPHER_CTX_init( &aes_ctx );
+- EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
+- EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
++#else
++ EVP_CIPHER_CTX_reset( pAes_ctx );
++#endif
++ EVP_DecryptInit_ex( pAes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
++ EVP_CIPHER_CTX_set_padding( pAes_ctx, 0 );
+ sal_uInt8 pnTmpVerifierHash[ 32 ];
+ (void) memset( pnTmpVerifierHash, 0, sizeof(pnTmpVerifierHash) );
+
+- /*int*/ EVP_DecryptUpdate( &aes_ctx, pnTmpVerifierHash, &nOutLen, pnVerifierHash, nVerifierHashSize );
++ /*int*/ EVP_DecryptUpdate( pAes_ctx, pnTmpVerifierHash, &nOutLen, pnVerifierHash, nVerifierHashSize );
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_cleanup( &aes_ctx );
++#else
++ EVP_CIPHER_CTX_free( pAes_ctx );
++#endif
+
+ rtlDigest aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
+ rtlDigestError aError = rtl_digest_update( aDigest, pnTmpVerifier, sizeof( pnTmpVerifier ) );
+@@ -562,10 +577,16 @@ Reference< XInputStream > FilterDetect::extractUnencry
+ BinaryXOutputStream aDecryptedPackage( xDecryptedPackage, true );
+ BinaryXInputStream aEncryptedPackage( xEncryptedPackage, true );
+
++ EVP_CIPHER_CTX *pAes_ctx;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX aes_ctx;
+ EVP_CIPHER_CTX_init( &aes_ctx );
+- EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, aVerifier.getKey(), 0 );
+- EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
++ pAes_ctx = &aes_ctx;
++#else
++ pAes_ctx = EVP_CIPHER_CTX_new();
++#endif
++ EVP_DecryptInit_ex( pAes_ctx, EVP_aes_128_ecb(), 0, aVerifier.getKey(), 0 );
++ EVP_CIPHER_CTX_set_padding( pAes_ctx, 0 );
+
+ sal_uInt8 pnInBuffer[ 1024 ];
+ sal_uInt8 pnOutBuffer[ 1024 ];
+@@ -574,13 +595,17 @@ Reference< XInputStream > FilterDetect::extractUnencry
+ aEncryptedPackage.skip( 8 ); // decrypted size
+ while( (nInLen = aEncryptedPackage.readMemory( pnInBuffer, sizeof( pnInBuffer ) )) > 0 )
+ {
+- EVP_DecryptUpdate( &aes_ctx, pnOutBuffer, &nOutLen, pnInBuffer, nInLen );
++ EVP_DecryptUpdate( pAes_ctx, pnOutBuffer, &nOutLen, pnInBuffer, nInLen );
+ aDecryptedPackage.writeMemory( pnOutBuffer, nOutLen );
+ }
+- EVP_DecryptFinal_ex( &aes_ctx, pnOutBuffer, &nOutLen );
++ EVP_DecryptFinal_ex( pAes_ctx, pnOutBuffer, &nOutLen );
+ aDecryptedPackage.writeMemory( pnOutBuffer, nOutLen );
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_cleanup( &aes_ctx );
++#else
++ EVP_CIPHER_CTX_free( pAes_ctx );
++#endif
+ xDecryptedPackage->flush();
+ aDecryptedPackage.seekToStart();
+