diff --git a/archivers/libunrar/Makefile b/archivers/libunrar/Makefile index a79b0fff77e1..8f1b89f5af2e 100644 --- a/archivers/libunrar/Makefile +++ b/archivers/libunrar/Makefile @@ -1,52 +1,52 @@ PORTNAME= libunrar -PORTVERSION= 7.2.3 +PORTVERSION= 7.2.7 PORTEPOCH= 1 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 cpe gmake CPE_VENDOR= rarlab CPE_PRODUCT= unrar USE_LDCONFIG= yes 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.${PORTVERSION:R:R} 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/libunrar/distinfo b/archivers/libunrar/distinfo index 4af125a61462..699b21b96342 100644 --- a/archivers/libunrar/distinfo +++ b/archivers/libunrar/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1767422746 -SHA256 (unrarsrc-7.2.3.tar.gz) = 3995af0aa32b1505a566da053725551a1f0698dc42b2fdf7ba7d65db0d004e33 -SIZE (unrarsrc-7.2.3.tar.gz) = 270056 +TIMESTAMP = 1783220690 +SHA256 (unrarsrc-7.2.7.tar.gz) = 01d903a7dcf413cb2925696d7796e48e38d471f79bfe7ef3ad2aebf6c12dbefd +SIZE (unrarsrc-7.2.7.tar.gz) = 270458 diff --git a/archivers/libunrar/files/patch-os.hpp b/archivers/libunrar/files/patch-os.hpp index f3936d120c1b..4328e98d7527 100644 --- a/archivers/libunrar/files/patch-os.hpp +++ b/archivers/libunrar/files/patch-os.hpp @@ -1,28 +1,28 @@ ---- os.hpp.orig 2025-02-12 14:05:27 UTC +--- os.hpp.orig 2026-06-27 11:35:31 UTC +++ os.hpp -@@ -158,10 +158,13 @@ +@@ -162,10 +162,13 @@ #if defined(__aarch64__) && (defined(__ARM_FEATURE_CRYPTO) || defined(__ARM_FEATURE_CRC32)) #include -#ifndef _APPLE +#if !defined(_APPLE) && !defined(__FreeBSD__) #include #include #endif +#ifdef __FreeBSD__ +#include +#endif #ifdef __ARM_FEATURE_CRYPTO #define USE_NEON_AES #endif -@@ -169,6 +172,10 @@ +@@ -173,6 +176,10 @@ #define USE_NEON_CRC32 #endif #endif + +#if defined(OPENSSL_AES) +#include +#endif // OPENSSL_AES #ifdef S_IFLNK #define SAVE_LINKS diff --git a/archivers/libunrar/files/patch-rijndael.cpp b/archivers/libunrar/files/patch-rijndael.cpp index ab554519c3b9..7abad2007f7d 100644 --- a/archivers/libunrar/files/patch-rijndael.cpp +++ b/archivers/libunrar/files/patch-rijndael.cpp @@ -1,182 +1,184 @@ ---- rijndael.cpp.orig 2025-02-12 14:05:27 UTC +--- rijndael.cpp.orig 2026-06-27 11:35:32 UTC +++ rijndael.cpp @@ -3,6 +3,7 @@ **************************************************************************/ #include "rar.hpp" +#if !defined(OPENSSL_AES) #ifdef USE_SSE #include #endif @@ -74,6 +75,7 @@ inline void Copy128(byte *dest,const byte *src) dest[I]=src[I]; #endif } +#endif // OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -82,21 +84,50 @@ Rijndael::Rijndael() +@@ -82,16 +84,20 @@ Rijndael::Rijndael() Rijndael::Rijndael() { +#if !defined(OPENSSL_AES) if (S5[0]==0) GenerateTables(); +#endif // OPENSSL_AES m_uRounds = 0; CBCMode = true; // Always true for RAR. +#if !defined(OPENSSL_AES) #ifdef USE_SSE AES_NI=false; #endif #ifdef USE_NEON_AES AES_Neon=false; #endif +#endif // OPENSSL_AES } +@@ -104,6 +110,31 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint + void Rijndael::Init(bool Encrypt,const byte *key,uint keyLen,const byte * initVector) { +#if defined(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 // OPENSSL_VERSION_NUMBER + EVP_CIPHER_CTX_init(ctx); + EVP_CipherInit_ex(ctx, cipher, NULL, key, initVector, Encrypt); + EVP_CIPHER_CTX_set_padding(ctx, 0); +#endif // OPENSSL_VERSION_NUMBER +#else // OPENSSL_AES // 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) -@@ -116,7 +147,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint +@@ -123,7 +154,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint #endif #elif defined(USE_NEON_AES) - #ifdef _APPLE + #if defined(_APPLE) // getauxval isn't available in OS X uint Value=0; size_t Size=sizeof(Value); -@@ -126,6 +157,12 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint +@@ -133,6 +164,12 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint // because "hw.optional.arm.FEAT_AES" was missing in OS X 11, but AES // still was supported by Neon. AES_Neon=RetCode!=0 || Value!=0; + #elif defined(__FreeBSD__) + // getauxval isn't available on FreeBSD + uint64 Reg=READ_SPECIALREG(id_aa64isar0_el1); + if (ID_AA64ISAR0_AES_VAL(Reg) == ID_AA64ISAR0_AES_BASE) { + AES_Neon=true; + } #else AES_Neon=(getauxval(AT_HWCAP) & HWCAP_AES)!=0; #endif -@@ -166,6 +203,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint +@@ -173,6 +210,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint if(!Encrypt) keyEncToDec(); +#endif // OPENSSL_AES } -@@ -174,6 +212,15 @@ void Rijndael::blockEncrypt(const byte *input,size_t i +@@ -181,6 +219,15 @@ void Rijndael::blockEncrypt(const byte *input,size_t i if (inputLen <= 0) return; +#if defined(OPENSSL_AES) + int outLen; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); +#else // OPENSSL_VERSION_NUMBER + EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); +#endif // OPENSSL_VERSION_NUMBER + return; +#else // OPENSSL_AES size_t numBlocks = inputLen/16; #if defined(USE_SSE) if (AES_NI) -@@ -238,9 +285,11 @@ void Rijndael::blockEncrypt(const byte *input,size_t i +@@ -245,9 +292,11 @@ void Rijndael::blockEncrypt(const byte *input,size_t i input += 16; } Copy128(m_initVector,prevBlock); +#endif // OPENSSL_AES } +#if !defined(OPENSSL_AES) #ifdef USE_SSE void Rijndael::blockEncryptSSE(const byte *input,size_t numBlocks,byte *outBuffer) { -@@ -306,6 +355,7 @@ void Rijndael::blockEncryptNeon(const byte *input,size +@@ -313,6 +362,7 @@ void Rijndael::blockEncryptNeon(const byte *input,size return; } #endif +#endif // OPENSSL_AES void Rijndael::blockDecrypt(const byte *input, size_t inputLen, byte *outBuffer) -@@ -313,6 +363,15 @@ void Rijndael::blockDecrypt(const byte *input, size_t +@@ -320,6 +370,15 @@ void Rijndael::blockDecrypt(const byte *input, size_t if (inputLen <= 0) return; +#if defined(OPENSSL_AES) + int outLen; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); +#else // OPENSSL_VERSION_NUMBER + EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); +#endif // OPENSSL_VERSION_NUMBER + return; +#else // OPENSSL_AES size_t numBlocks=inputLen/16; #if defined(USE_SSE) if (AES_NI) -@@ -381,9 +440,11 @@ void Rijndael::blockDecrypt(const byte *input, size_t +@@ -388,9 +447,11 @@ void Rijndael::blockDecrypt(const byte *input, size_t } memcpy(m_initVector,iv,16); +#endif // OPENSSL_AES } +#if !defined(OPENSSL_AES) #ifdef USE_SSE void Rijndael::blockDecryptSSE(const byte *input, size_t numBlocks, byte *outBuffer) { -@@ -450,8 +511,10 @@ void Rijndael::blockDecryptNeon(const byte *input, siz +@@ -457,8 +518,10 @@ void Rijndael::blockDecryptNeon(const byte *input, siz memcpy(m_initVector,iv,16); } #endif +#endif // OPENSSL_AES +#if !defined(OPENSSL_AES) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ALGORITHM ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -580,6 +643,7 @@ void Rijndael::GenerateTables() +@@ -587,6 +650,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 diff --git a/filesystems/rar2fs/Makefile b/filesystems/rar2fs/Makefile index 1801b5ef2f02..85a61e1356d0 100644 --- a/filesystems/rar2fs/Makefile +++ b/filesystems/rar2fs/Makefile @@ -1,37 +1,37 @@ PORTNAME= rar2fs DISTVERSIONPREFIX= v DISTVERSION= 1.29.7 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= filesystems 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:${LIBUNRAR_PORT} USES= autoreconf compiler:c11 fuse gettext-tools gmake USE_GITHUB= yes GH_ACCOUNT= hasse69 GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-static-unrar \ --with-fuse=${LOCALBASE}/include/fuse \ --with-fuse-lib=${LOCALBASE}/lib \ --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 \ share/man/man1/rar2fs.1.gz LIBUNRAR_PORT= archivers/libunrar LIBUNRAR_PKG= ${LIBUNRAR_PORT:S|archivers/||} .include