Index: head/archivers/libunrar5/Makefile =================================================================== --- head/archivers/libunrar5/Makefile (revision 447276) +++ head/archivers/libunrar5/Makefile (revision 447277) @@ -1,59 +1,53 @@ # $FreeBSD$ PORTNAME= libunrar5 -PORTVERSION= 5.4.5 -PORTREVISION= 1 +PORTVERSION= 5.5.7 CATEGORIES= archivers MASTER_SITES= http://www.rarlab.com/rar/ DISTNAME= unrarsrc-${PORTVERSION} MAINTAINER= jhale@FreeBSD.org COMMENT= RAR archive extraction library LICENSE= UNRAR LICENSE_NAME= UnRAR License LICENSE_FILE= ${WRKSRC}/license.txt LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept USES= gmake USE_LDCONFIG= yes -ALL_TARGET= lib liba +ALL_TARGET= lib MAKEFILE= makefile MAKE_ARGS= AR="${AR}" \ CXX="${CXX}" \ CXXFLAGS="${CXXFLAGS} -fPIC" \ LDFLAGS="-Wl,-soname,${SONAME} -pthread ${LDFLAGS}" \ STRIP="${STRIP_CMD}" SONAME= libunrar.so.5 WRKSRC= ${WRKDIR}/unrar CONFLICTS_INSTALL= libunrar-3* libunrar4-4* OPTIONS_DEFINE= OPENSSL_AES OPTIONS_DEFAULT= OPENSSL_AES OPENSSL_AES_DESC= Use OpenSSL implementation of AES OPENSSL_AES_CPPFLAGS= -DOPENSSL_AES -I${OPENSSLINC} OPENSSL_AES_LDFLAGS= -L${OPENSSLLIB} -lcrypto OPENSSL_AES_USES= ssl +OPENSSL_AES_VARS= BROKEN_SSL=openssl-devel PLIST_FILES= lib/libunrar.a \ lib/libunrar.so \ lib/${SONAME} \ include/libunrar5/dll.hpp do-install: ${INSTALL_DATA} ${WRKSRC}/libunrar.a ${STAGEDIR}${PREFIX}/lib/libunrar.a ${INSTALL_LIB} ${WRKSRC}/libunrar.so ${STAGEDIR}${PREFIX}/lib/${SONAME} (cd ${STAGEDIR}${PREFIX}/lib; ${LN} -sf ${SONAME} libunrar.so) @${MKDIR} ${STAGEDIR}${PREFIX}/include/libunrar5 ${INSTALL_DATA} ${WRKSRC}/dll.hpp ${STAGEDIR}${PREFIX}/include/libunrar5/dll.hpp -.include - -.if ${PORT_OPTIONS:MOPENSSL_AES} && ${SSL_DEFAULT:Mopenssl-devel} -BROKEN= OPENSSL_AES option does not build with openssl-devel -.endif - -.include +.include Index: head/archivers/libunrar5/distinfo =================================================================== --- head/archivers/libunrar5/distinfo (revision 447276) +++ head/archivers/libunrar5/distinfo (revision 447277) @@ -1,3 +1,3 @@ -TIMESTAMP = 1483207045 -SHA256 (unrarsrc-5.4.5.tar.gz) = e470c584332422893fb52e049f2cbd99e24dc6c6da971008b4e2ae4284f8796c -SIZE (unrarsrc-5.4.5.tar.gz) = 226320 +TIMESTAMP = 1501787450 +SHA256 (unrarsrc-5.5.7.tar.gz) = 8aef0a0d91bf9c9ac48fab8a26049ac7ac49907e75a2dcbd511a4ba375322d8f +SIZE (unrarsrc-5.5.7.tar.gz) = 222293 Index: head/archivers/libunrar5/files/patch-makefile =================================================================== --- head/archivers/libunrar5/files/patch-makefile (revision 447276) +++ head/archivers/libunrar5/files/patch-makefile (nonexistent) @@ -1,28 +0,0 @@ ---- makefile.orig 2016-05-10 09:51:35 UTC -+++ makefile -@@ -98,7 +98,7 @@ LINK=$(CXX) - WHAT=UNRAR - - UNRAR_OBJ=filestr.o recvol.o rs.o scantree.o qopen.o --LIB_OBJ=filestr.o scantree.o dll.o qopen.o -+LIB_OBJ=dll.o - - OBJECTS=rar.o strlist.o strfn.o pathfn.o smallfn.o global.o file.o filefn.o filcreat.o \ - archive.o arcread.o unicode.o system.o isnt.o crypt.o crc.o rawread.o encname.o \ -@@ -131,9 +131,14 @@ sfx: clean $(OBJECTS) - - lib: WHAT=RARDLL - lib: CXXFLAGS+=$(LIBFLAGS) --lib: clean $(OBJECTS) $(LIB_OBJ) -+lib: $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ) - @rm -f libunrar.so -- $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ) -+ $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ) -+ -+liba: WHAT=RARDLL -+liba: $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ) -+ @rm -f libunrar.a -+ $(AR) rcs libunrar.a $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ) - - install-unrar: - install -D unrar $(DESTDIR)/bin/unrar Property changes on: head/archivers/libunrar5/files/patch-makefile ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/archivers/libunrar5/files/patch-os.hpp =================================================================== --- head/archivers/libunrar5/files/patch-os.hpp (revision 447276) +++ head/archivers/libunrar5/files/patch-os.hpp (revision 447277) @@ -1,13 +1,13 @@ ---- os.hpp.orig 2013-12-01 08:10:14 UTC +--- os.hpp.orig 2017-04-28 17:28:46 UTC +++ os.hpp -@@ -151,6 +151,10 @@ - #include +@@ -150,6 +150,10 @@ #include + +#ifdef OPENSSL_AES +#include +#endif // OPENSSL_AES + #ifdef S_IFLNK #define SAVE_LINKS #endif Index: head/archivers/libunrar5/files/patch-rijndael.cpp =================================================================== --- head/archivers/libunrar5/files/patch-rijndael.cpp (revision 447276) +++ head/archivers/libunrar5/files/patch-rijndael.cpp (revision 447277) @@ -1,102 +1,122 @@ ---- rijndael.cpp.orig 2014-06-10 17:14:06 UTC +--- rijndael.cpp.orig 2017-04-28 17:28:47 UTC +++ rijndael.cpp @@ -7,6 +7,8 @@ ***************************************************************************/ #include "rar.hpp" +#ifndef OPENSSL_AES + #ifdef USE_SSE #include #endif -@@ -56,6 +58,7 @@ +@@ -56,6 +58,7 @@ inline void Copy128(byte *dest,const byt #endif } +#endif // OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // API -@@ -63,14 +66,35 @@ +@@ -63,14 +66,35 @@ inline void Copy128(byte *dest,const byt Rijndael::Rijndael() { +#ifndef OPENSSL_AES if (S[0]==0) GenerateTables(); +#endif // OPENSSL_AES CBCMode = true; // Always true for RAR. } void Rijndael::Init(bool Encrypt,const byte *key,uint keyLen,const byte * initVector) { +#ifdef OPENSSL_AES + const EVP_CIPHER *cipher; + switch(keyLen) + { + case 128: + cipher = EVP_aes_128_cbc(); + break; + case 192: + cipher = EVP_aes_192_cbc(); + break; + case 256: + cipher = EVP_aes_256_cbc(); + break; + } + + EVP_CIPHER_CTX_init(&ctx); + EVP_CipherInit_ex(&ctx, cipher, NULL, key, initVector, Encrypt); + EVP_CIPHER_CTX_set_padding(&ctx, 0); +#else // OPENSSL_AES #ifdef USE_SSE // Check SSE here instead of constructor, so if object is a part of some // structure memset'ed before use, this variable is not lost. -@@ -111,6 +135,7 @@ +@@ -111,6 +135,7 @@ void Rijndael::Init(bool Encrypt,const b if(!Encrypt) keyEncToDec(); +#endif // OPENSSL_AES } + void Rijndael::blockEncrypt(const byte *input,size_t inputLen,byte *outBuffer) +@@ -118,6 +143,11 @@ void Rijndael::blockEncrypt(const byte * + if (inputLen <= 0) + return; -@@ -120,6 +145,11 @@ ++#ifdef OPENSSL_AES ++ int outLen; ++ EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); ++ return; ++#else // OPENSSL_AES + size_t numBlocks = inputLen/16; + #ifdef USE_SSE + if (AES_NI) +@@ -176,6 +206,7 @@ void Rijndael::blockEncrypt(const byte * + input += 16; + } + Copy128(m_initVector,prevBlock); ++#endif // OPENSSL_AES + } + + +@@ -217,6 +248,11 @@ void Rijndael::blockDecrypt(const byte * if (inputLen <= 0) return; +#ifdef OPENSSL_AES + int outLen; + EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); + return; +#else // OPENSSL_AES size_t numBlocks=inputLen/16; #ifdef USE_SSE if (AES_NI) -@@ -182,6 +212,8 @@ +@@ -279,6 +315,8 @@ void Rijndael::blockDecrypt(const byte * } memcpy(m_initVector,iv,16); + +#endif // OPENSSL_AES } -@@ -217,7 +249,7 @@ +@@ -314,7 +352,7 @@ void Rijndael::blockDecryptSSE(const byt } #endif - +#ifndef OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ALGORITHM ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -357,7 +389,7 @@ +@@ -454,7 +492,7 @@ void Rijndael::GenerateTables() U1[b][0]=U2[b][1]=U3[b][2]=U4[b][3]=T5[i][0]=T6[i][1]=T7[i][2]=T8[i][3]=FFmul0e(b); } } - +#endif // OPENSSL_AES #if 0 static void TestRijndael(); Index: head/archivers/libunrar5/files/patch-rijndael.hpp =================================================================== --- head/archivers/libunrar5/files/patch-rijndael.hpp (revision 447276) +++ head/archivers/libunrar5/files/patch-rijndael.hpp (revision 447277) @@ -1,20 +1,20 @@ ---- rijndael.hpp.orig 2014-06-10 17:14:06 UTC +--- rijndael.hpp.orig 2017-04-28 17:28:47 UTC +++ rijndael.hpp @@ -16,6 +16,9 @@ class Rijndael { private: +#ifdef OPENSSL_AES + EVP_CIPHER_CTX ctx; +#else // OPENSSL_AES #ifdef USE_SSE void blockEncryptSSE(const byte *input,size_t numBlocks,byte *outBuffer); void blockDecryptSSE(const byte *input, size_t numBlocks, byte *outBuffer); -@@ -25,6 +28,7 @@ +@@ -25,6 +28,7 @@ class Rijndael void keySched(byte key[_MAX_KEY_COLUMNS][4]); void keyEncToDec(); void GenerateTables(); +#endif // OPENSSL_AES // RAR always uses CBC, but we may need to turn it off when calling // this code from other archive formats with CTR and other modes.