diff --git a/archivers/libunrar6/Makefile b/archivers/libunrar6/Makefile index 1253e645ca82..2e746185298c 100644 --- a/archivers/libunrar6/Makefile +++ b/archivers/libunrar6/Makefile @@ -1,51 +1,51 @@ PORTNAME= libunrar6 -PORTVERSION= 6.1.7 +PORTVERSION= 6.2.8 CATEGORIES= archivers MASTER_SITES= http://www.rarlab.com/rar/ DISTNAME= unrarsrc-${PORTVERSION} MAINTAINER= jhale@FreeBSD.org COMMENT= RAR archive extraction library WWW= https://www.rarlab.com/ 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 1a3c449ee7ae..b35936afea0e 100644 --- a/archivers/libunrar6/distinfo +++ b/archivers/libunrar6/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1653701807 -SHA256 (unrarsrc-6.1.7.tar.gz) = de75b6136958173fdfc530d38a0145b72342cf0d3842bf7bb120d336602d88ed -SIZE (unrarsrc-6.1.7.tar.gz) = 236798 +TIMESTAMP = 1686905718 +SHA256 (unrarsrc-6.2.8.tar.gz) = 1777e3d3b073815ff68a411ddb1ab76d0a4e1f58ecc7080035b27b52967ff911 +SIZE (unrarsrc-6.2.8.tar.gz) = 246249 diff --git a/archivers/libunrar6/files/patch-os.hpp b/archivers/libunrar6/files/patch-os.hpp index c0a0c1604907..ef633fb42257 100644 --- a/archivers/libunrar6/files/patch-os.hpp +++ b/archivers/libunrar6/files/patch-os.hpp @@ -1,13 +1,13 @@ ---- os.hpp.orig 2022-01-24 07:33:18 UTC +--- os.hpp.orig 2023-01-17 16:25:54 UTC +++ os.hpp -@@ -168,6 +168,10 @@ +@@ -173,6 +173,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 19749b3b7403..92b411d99b5c 100644 --- a/archivers/libunrar6/files/patch-rijndael.cpp +++ b/archivers/libunrar6/files/patch-rijndael.cpp @@ -1,136 +1,136 @@ ---- rijndael.cpp.orig 2022-01-24 07:33:18 UTC +--- rijndael.cpp.orig 2023-01-17 16:25:54 UTC +++ rijndael.cpp @@ -3,6 +3,8 @@ **************************************************************************/ #include "rar.hpp" +#ifndef OPENSSL_AES + #ifdef USE_SSE #include #endif @@ -75,6 +77,7 @@ inline void Copy128(byte *dest,const byte *src) #endif } +#endif // OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // API @@ -82,14 +85,41 @@ inline void Copy128(byte *dest,const byte *src) Rijndael::Rijndael() { +#ifndef OPENSSL_AES 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. -@@ -139,6 +169,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint + // Check SIMD here instead of constructor, so if object is a part of some + // structure memset'ed before use, these variables are not lost. + #if defined(USE_SSE) +@@ -141,6 +171,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) -@@ -146,6 +177,15 @@ void Rijndael::blockEncrypt(const byte *input,size_t i + +@@ -149,6 +180,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 defined(USE_SSE) if (AES_NI) -@@ -204,6 +244,7 @@ void Rijndael::blockEncrypt(const byte *input,size_t i +@@ -213,6 +253,7 @@ void Rijndael::blockEncrypt(const byte *input,size_t i input += 16; } Copy128(m_initVector,prevBlock); +#endif // OPENSSL_AES } -@@ -245,6 +286,15 @@ void Rijndael::blockDecrypt(const byte *input, size_t +@@ -288,6 +329,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 defined(USE_SSE) if (AES_NI) -@@ -307,6 +357,8 @@ void Rijndael::blockDecrypt(const byte *input, size_t +@@ -356,6 +406,8 @@ void Rijndael::blockDecrypt(const byte *input, size_t } memcpy(m_initVector,iv,16); + +#endif // OPENSSL_AES } -@@ -342,7 +394,7 @@ void Rijndael::blockDecryptSSE(const byte *input, size +@@ -426,7 +478,7 @@ void Rijndael::blockDecryptNeon(const byte *input, siz } #endif - +#ifndef OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ALGORITHM ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -471,7 +523,7 @@ void Rijndael::GenerateTables() +@@ -555,7 +607,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 3c375833ef8e..0e1ccbfbd379 100644 --- a/archivers/libunrar6/files/patch-rijndael.hpp +++ b/archivers/libunrar6/files/patch-rijndael.hpp @@ -1,24 +1,24 @@ ---- rijndael.hpp.orig 2022-01-24 07:33:18 UTC +--- rijndael.hpp.orig 2023-01-17 16:25:54 UTC +++ rijndael.hpp @@ -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); -@@ -21,6 +28,7 @@ class Rijndael +@@ -31,6 +38,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 68268024cfcd..c75f638c187a 100644 --- a/sysutils/fusefs-rar2fs/Makefile +++ b/sysutils/fusefs-rar2fs/Makefile @@ -1,37 +1,37 @@ PORTNAME= rar2fs DISTVERSION= 1.29.5 DISTVERSIONPREFIX= v -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils PKGNAMEPREFIX= fusefs- MAINTAINER= n_carlsson@outlook.com COMMENT= Mount RAR archives as file system WWW= https://hasse69.github.io/rar2fs/ 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