diff options
-rw-r--r-- | archivers/unrar/Makefile | 4 | ||||
-rw-r--r-- | archivers/unrar/distinfo | 4 | ||||
-rw-r--r-- | archivers/unrar/files/patch-rijndael.cpp | 52 | ||||
-rw-r--r-- | archivers/unrar/files/patch-rijndael.hpp | 18 |
4 files changed, 48 insertions, 30 deletions
diff --git a/archivers/unrar/Makefile b/archivers/unrar/Makefile index d2d11bd9131f..03a3f644e843 100644 --- a/archivers/unrar/Makefile +++ b/archivers/unrar/Makefile @@ -2,12 +2,12 @@ # $FreeBSD$ PORTNAME= unrar -PORTVERSION= 5.01 +PORTVERSION= 5.10 PORTEPOCH= 5 CATEGORIES+= archivers MASTER_SITES= http://www.rarlab.com/rar/ \ LOCAL/sunpoet -DISTNAME= unrarsrc-5.0.14 +DISTNAME= unrarsrc-5.1.6 MAINTAINER?= sunpoet@FreeBSD.org COMMENT= Extract, view & test RAR archives diff --git a/archivers/unrar/distinfo b/archivers/unrar/distinfo index d4f43917f899..c7a17ef27b7a 100644 --- a/archivers/unrar/distinfo +++ b/archivers/unrar/distinfo @@ -1,2 +1,2 @@ -SHA256 (unrarsrc-5.0.14.tar.gz) = e276ea30a2dc9b8961a4268772e5b6caccaa984664e2d5255a43fcb0f5d59806 -SIZE (unrarsrc-5.0.14.tar.gz) = 209707 +SHA256 (unrarsrc-5.1.6.tar.gz) = 3c38eaabc655527244fd0c3ba3beff567ea24aad37d448488643242fd4cf41a5 +SIZE (unrarsrc-5.1.6.tar.gz) = 215185 diff --git a/archivers/unrar/files/patch-rijndael.cpp b/archivers/unrar/files/patch-rijndael.cpp index a8fe66a95125..1ec85574c504 100644 --- a/archivers/unrar/files/patch-rijndael.cpp +++ b/archivers/unrar/files/patch-rijndael.cpp @@ -1,15 +1,15 @@ ---- rijndael.cpp.orig 2013-12-01 16:10:14.000000000 +0800 -+++ rijndael.cpp 2014-02-04 08:42:17.943981810 +0800 +--- rijndael.cpp.orig 2014-06-11 01:14:06.000000000 +0800 ++++ rijndael.cpp 2014-07-31 22:46:27.956084561 +0800 @@ -7,6 +7,8 @@ ***************************************************************************/ #include "rar.hpp" +#ifndef OPENSSL_AES + - static byte S[256],S5[256],rcon[30]; - static byte T1[256][4],T2[256][4],T3[256][4],T4[256][4]; - static byte T5[256][4],T6[256][4],T7[256][4],T8[256][4]; -@@ -52,6 +54,7 @@ + #ifdef USE_SSE + #include <wmmintrin.h> + #endif +@@ -56,6 +58,7 @@ #endif } @@ -17,7 +17,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // API -@@ -59,13 +62,34 @@ +@@ -63,14 +66,35 @@ Rijndael::Rijndael() { @@ -25,6 +25,7 @@ if (S[0]==0) GenerateTables(); +#endif // OPENSSL_AES + CBCMode = true; // Always true for RAR. } @@ -49,10 +50,10 @@ + EVP_CipherInit_ex(&ctx, cipher, NULL, key, initVector, Encrypt); + EVP_CIPHER_CTX_set_padding(&ctx, 0); +#else // OPENSSL_AES - uint uKeyLenInBytes; - switch(keyLen) - { -@@ -95,6 +119,7 @@ + #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 @@ if(!Encrypt) keyEncToDec(); @@ -60,35 +61,42 @@ } -@@ -104,6 +129,11 @@ - if (input == 0 || inputLen <= 0) - return 0; +@@ -120,6 +145,11 @@ + if (inputLen <= 0) + return; +#ifdef OPENSSL_AES + int outLen; + EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); -+ return outLen; ++ return; +#else // OPENSSL_AES - byte block[16], iv[4][4]; - memcpy(iv,m_initVector,16); + size_t numBlocks=inputLen/16; + #ifdef USE_SSE + if (AES_NI) +@@ -182,6 +212,8 @@ + } -@@ -126,9 +156,11 @@ memcpy(m_initVector,iv,16); - - return 16*numBlocks; ++ +#endif // OPENSSL_AES } +@@ -217,7 +249,7 @@ + } + #endif + +- +#ifndef OPENSSL_AES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ALGORITHM ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -309,6 +341,7 @@ +@@ -357,7 +389,7 @@ 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(); diff --git a/archivers/unrar/files/patch-rijndael.hpp b/archivers/unrar/files/patch-rijndael.hpp index 816a0c91aad3..d37dc6620330 100644 --- a/archivers/unrar/files/patch-rijndael.hpp +++ b/archivers/unrar/files/patch-rijndael.hpp @@ -1,5 +1,5 @@ ---- rijndael.hpp.orig 2013-12-01 16:10:14.000000000 +0800 -+++ rijndael.hpp 2014-02-04 08:48:42.137144316 +0800 +--- rijndael.hpp.orig 2014-06-11 01:14:06.000000000 +0800 ++++ rijndael.hpp 2014-07-31 22:47:47.292079919 +0800 @@ -16,6 +16,9 @@ class Rijndael { @@ -7,10 +7,20 @@ +#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,14 +28,17 @@ void keySched(byte key[_MAX_KEY_COLUMNS][4]); void keyEncToDec(); - void encrypt(const byte a[16], byte b[16]); -@@ -25,6 +28,7 @@ + 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. + bool CBCMode; + ++#ifdef OPENSSL_AES int m_uRounds; byte m_initVector[MAX_IV_SIZE]; byte m_expandedKey[_MAX_ROUNDS+1][4][4]; |