diff --git a/archivers/libunrar6/Makefile b/archivers/libunrar6/Makefile index 631c3cc273a8..fd40cfa06542 100644 --- a/archivers/libunrar6/Makefile +++ b/archivers/libunrar6/Makefile @@ -1,50 +1,50 @@ PORTNAME= libunrar6 -PORTVERSION= 6.0.7 +PORTVERSION= 6.1.6 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= compiler:c++11-lang gmake USE_LDCONFIG= yes CONFLICTS_INSTALL= libunrar # lib/libunrar.so 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.6 WRKSRC= ${WRKDIR}/unrar 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 PLIST_FILES= lib/libunrar.a \ lib/libunrar.so \ lib/${SONAME} \ include/${PORTNAME}/dll.hpp do-install: ${INSTALL_DATA} ${WRKSRC}/libunrar.a ${STAGEDIR}${PREFIX}/lib/libunrar.a ${INSTALL_LIB} ${WRKSRC}/libunrar.so ${STAGEDIR}${PREFIX}/lib/${SONAME} ${RLN} ${STAGEDIR}${PREFIX}/lib/${SONAME} ${STAGEDIR}${PREFIX}/lib/${SONAME:R} @${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME} ${INSTALL_DATA} ${WRKSRC}/dll.hpp ${STAGEDIR}${PREFIX}/include/${PORTNAME}/dll.hpp .include diff --git a/archivers/libunrar6/distinfo b/archivers/libunrar6/distinfo index 710e0cc15a1b..4d84265bcb8c 100644 --- a/archivers/libunrar6/distinfo +++ b/archivers/libunrar6/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1645632381 -SHA256 (unrarsrc-6.0.7.tar.gz) = a7029942006cbcced3f3b7322ec197683f8e7be408972ca08099b196c038f518 -SIZE (unrarsrc-6.0.7.tar.gz) = 232903 +TIMESTAMP = 1646677210 +SHA256 (unrarsrc-6.1.6.tar.gz) = 67f4ab891c062218c2badfaac9c8cab5c8bfd5e96dabfca56c8faa3d209a801d +SIZE (unrarsrc-6.1.6.tar.gz) = 236651 diff --git a/archivers/libunrar6/files/patch-os.hpp b/archivers/libunrar6/files/patch-os.hpp index dff506575c08..c0a0c1604907 100644 --- a/archivers/libunrar6/files/patch-os.hpp +++ b/archivers/libunrar6/files/patch-os.hpp @@ -1,13 +1,13 @@ ---- os.hpp.orig 2017-04-28 17:28:46 UTC +--- os.hpp.orig 2022-01-24 07:33:18 UTC +++ os.hpp -@@ -150,6 +150,10 @@ +@@ -168,6 +168,10 @@ #include +#ifdef OPENSSL_AES +#include +#endif // OPENSSL_AES + #ifdef S_IFLNK #define SAVE_LINKS #endif diff --git a/archivers/libunrar6/files/patch-rijndael.cpp b/archivers/libunrar6/files/patch-rijndael.cpp index 93d60494b85c..19749b3b7403 100644 --- a/archivers/libunrar6/files/patch-rijndael.cpp +++ b/archivers/libunrar6/files/patch-rijndael.cpp @@ -1,136 +1,136 @@ ---- rijndael.cpp.orig 2018-06-24 15:10:31 UTC +--- rijndael.cpp.orig 2022-01-24 07:33:18 UTC +++ rijndael.cpp -@@ -7,6 +7,8 @@ - ***************************************************************************/ +@@ -3,6 +3,8 @@ + **************************************************************************/ #include "rar.hpp" +#ifndef OPENSSL_AES + #ifdef USE_SSE #include #endif -@@ -56,6 +58,7 @@ inline void Copy128(byte *dest,const byt +@@ -75,6 +77,7 @@ inline void Copy128(byte *dest,const byte *src) #endif } +#endif // OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // API -@@ -63,14 +66,41 @@ inline void Copy128(byte *dest,const byt +@@ -82,14 +85,41 @@ inline void Copy128(byte *dest,const byte *src) Rijndael::Rijndael() { +#ifndef OPENSSL_AES - if (S[0]==0) + if (S5[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; + } + +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_init(&ctx); + EVP_CipherInit_ex(&ctx, cipher, NULL, key, initVector, Encrypt); + EVP_CIPHER_CTX_set_padding(&ctx, 0); +#else + EVP_CIPHER_CTX_init(ctx); + EVP_CipherInit_ex(ctx, cipher, NULL, key, initVector, Encrypt); + EVP_CIPHER_CTX_set_padding(ctx, 0); +#endif +#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 +141,7 @@ void Rijndael::Init(bool Encrypt,const b +@@ -139,6 +169,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint if(!Encrypt) keyEncToDec(); +#endif // OPENSSL_AES } void Rijndael::blockEncrypt(const byte *input,size_t inputLen,byte *outBuffer) -@@ -118,6 +149,15 @@ void Rijndael::blockEncrypt(const byte * +@@ -146,6 +177,15 @@ void Rijndael::blockEncrypt(const byte *input,size_t i if (inputLen <= 0) return; +#ifdef OPENSSL_AES + int outLen; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); +#else + EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); +#endif + return; +#else // OPENSSL_AES size_t numBlocks = inputLen/16; #ifdef USE_SSE if (AES_NI) -@@ -176,6 +216,7 @@ void Rijndael::blockEncrypt(const byte * +@@ -204,6 +244,7 @@ void Rijndael::blockEncrypt(const byte *input,size_t i input += 16; } Copy128(m_initVector,prevBlock); +#endif // OPENSSL_AES } -@@ -217,6 +258,15 @@ void Rijndael::blockDecrypt(const byte * +@@ -245,6 +286,15 @@ void Rijndael::blockDecrypt(const byte *input, size_t if (inputLen <= 0) return; +#ifdef OPENSSL_AES + int outLen; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); +#else + EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); +#endif + return; +#else // OPENSSL_AES size_t numBlocks=inputLen/16; #ifdef USE_SSE if (AES_NI) -@@ -279,6 +329,8 @@ void Rijndael::blockDecrypt(const byte * +@@ -307,6 +357,8 @@ void Rijndael::blockDecrypt(const byte *input, size_t } memcpy(m_initVector,iv,16); + +#endif // OPENSSL_AES } -@@ -314,7 +366,7 @@ void Rijndael::blockDecryptSSE(const byt +@@ -342,7 +394,7 @@ void Rijndael::blockDecryptSSE(const byte *input, size } #endif - +#ifndef OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ALGORITHM ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -454,7 +506,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); +@@ -471,7 +523,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]=gmul(b,0xe); } } - +#endif // OPENSSL_AES #if 0 static void TestRijndael(); diff --git a/archivers/libunrar6/files/patch-rijndael.hpp b/archivers/libunrar6/files/patch-rijndael.hpp index e85656700db5..3c375833ef8e 100644 --- a/archivers/libunrar6/files/patch-rijndael.hpp +++ b/archivers/libunrar6/files/patch-rijndael.hpp @@ -1,24 +1,24 @@ ---- rijndael.hpp.orig 2018-06-24 15:10:31 UTC +--- rijndael.hpp.orig 2022-01-24 07:33:18 UTC +++ rijndael.hpp -@@ -16,6 +16,13 @@ +@@ -12,6 +12,13 @@ class Rijndael { private: +#ifdef OPENSSL_AES +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX ctx; +#else + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); +#endif +#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 +32,7 @@ class Rijndael +@@ -21,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. diff --git a/sysutils/fusefs-rar2fs/Makefile b/sysutils/fusefs-rar2fs/Makefile index 054ebdff4044..f45962929338 100644 --- a/sysutils/fusefs-rar2fs/Makefile +++ b/sysutils/fusefs-rar2fs/Makefile @@ -1,38 +1,38 @@ # Created by: Joris Vandalon PORTNAME= rar2fs -PORTREVISION= 1 DISTVERSION= 1.29.5 DISTVERSIONPREFIX= v +PORTREVISION= 2 CATEGORIES= sysutils PKGNAMEPREFIX= fusefs- MAINTAINER= n_carlsson@outlook.com COMMENT= Mount RAR archives as file system LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= ${NONEXISTENT}:${LIBUNRAR_PORT}:patch LIB_DEPENDS= libunrar.so.6:${LIBUNRAR_PORT} USES= autoreconf compiler:c11 gmake fuse USE_GITHUB= yes GH_ACCOUNT= hasse69 GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-static-unrar \ --with-fuse-lib=${LOCALBASE}/lib \ --with-fuse=${LOCALBASE}/include/fuse \ --with-unrar=`${MAKE} -C ${PORTSDIR}/${LIBUNRAR_PORT} -VWRKSRC` \ --with-unrar-lib=${LOCALBASE}/lib CONFIGURE_ENV= LIBUNRAR_PKG=${LIBUNRAR_PKG} PLIST_FILES= bin/${PORTNAME} \ bin/mkr2i \ man/man1/rar2fs.1.gz LIBUNRAR_PORT= archivers/libunrar6 LIBUNRAR_PKG= ${LIBUNRAR_PORT:S|archivers/||} .include