aboutsummaryrefslogtreecommitdiff
path: root/archivers/unrar
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2018-09-16 00:07:56 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2018-09-16 00:07:56 +0000
commit3f6f18a72e80e890175ad1fba018a455052f3671 (patch)
tree72c34c86254d89c59f3ca667413bf6a76e6ba121 /archivers/unrar
parentc126010bb7cebedce2a28fea26c1133248ea5167 (diff)
downloadports-3f6f18a72e80e890175ad1fba018a455052f3671.tar.gz
ports-3f6f18a72e80e890175ad1fba018a455052f3671.zip
Fix build with OpenSSL 1.1.*
PR: 228901 Reported by: brnrd
Notes
Notes: svn path=/head/; revision=479868
Diffstat (limited to 'archivers/unrar')
-rw-r--r--archivers/unrar/Makefile2
-rw-r--r--archivers/unrar/files/patch-rijndael.cpp32
-rw-r--r--archivers/unrar/files/patch-rijndael.hpp10
3 files changed, 30 insertions, 14 deletions
diff --git a/archivers/unrar/Makefile b/archivers/unrar/Makefile
index 41f7e9d8f6b4..0385bd8fef7b 100644
--- a/archivers/unrar/Makefile
+++ b/archivers/unrar/Makefile
@@ -17,8 +17,6 @@ LICENSE_FILE= ${WRKSRC}/license.txt
LICENSE_NAME= UnRAR license
LICENSE_PERMS= auto-accept dist-mirror pkg-mirror
-BROKEN_SSL= openssl-devel
-
OPTIONS_DEFINE= OPENSSL_AES
OPTIONS_DEFAULT=OPENSSL_AES
OPENSSL_AES_DESC= Use OpenSSL implementation of AES
diff --git a/archivers/unrar/files/patch-rijndael.cpp b/archivers/unrar/files/patch-rijndael.cpp
index 0d48cdad9eaa..93d60494b85c 100644
--- a/archivers/unrar/files/patch-rijndael.cpp
+++ b/archivers/unrar/files/patch-rijndael.cpp
@@ -1,4 +1,4 @@
---- rijndael.cpp.orig 2017-04-28 17:28:47 UTC
+--- rijndael.cpp.orig 2018-06-24 15:10:31 UTC
+++ rijndael.cpp
@@ -7,6 +7,8 @@
***************************************************************************/
@@ -17,7 +17,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// API
-@@ -63,14 +66,35 @@ inline void Copy128(byte *dest,const byt
+@@ -63,14 +66,41 @@ inline void Copy128(byte *dest,const byt
Rijndael::Rijndael()
{
@@ -46,14 +46,20 @@
+ 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 +135,7 @@ void Rijndael::Init(bool Encrypt,const b
+@@ -111,6 +141,7 @@ void Rijndael::Init(bool Encrypt,const b
if(!Encrypt)
keyEncToDec();
@@ -61,19 +67,23 @@
}
void Rijndael::blockEncrypt(const byte *input,size_t inputLen,byte *outBuffer)
-@@ -118,6 +143,11 @@ void Rijndael::blockEncrypt(const byte *
+@@ -118,6 +149,15 @@ void Rijndael::blockEncrypt(const byte *
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 +206,7 @@ void Rijndael::blockEncrypt(const byte *
+@@ -176,6 +216,7 @@ void Rijndael::blockEncrypt(const byte *
input += 16;
}
Copy128(m_initVector,prevBlock);
@@ -81,19 +91,23 @@
}
-@@ -217,6 +248,11 @@ void Rijndael::blockDecrypt(const byte *
+@@ -217,6 +258,15 @@ void Rijndael::blockDecrypt(const byte *
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 +315,8 @@ void Rijndael::blockDecrypt(const byte *
+@@ -279,6 +329,8 @@ void Rijndael::blockDecrypt(const byte *
}
memcpy(m_initVector,iv,16);
@@ -102,7 +116,7 @@
}
-@@ -314,7 +352,7 @@ void Rijndael::blockDecryptSSE(const byt
+@@ -314,7 +366,7 @@ void Rijndael::blockDecryptSSE(const byt
}
#endif
@@ -111,7 +125,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ALGORITHM
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-@@ -454,7 +492,7 @@ void Rijndael::GenerateTables()
+@@ -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);
}
}
diff --git a/archivers/unrar/files/patch-rijndael.hpp b/archivers/unrar/files/patch-rijndael.hpp
index 8cf2a821ed90..e85656700db5 100644
--- a/archivers/unrar/files/patch-rijndael.hpp
+++ b/archivers/unrar/files/patch-rijndael.hpp
@@ -1,16 +1,20 @@
---- rijndael.hpp.orig 2017-04-28 17:28:47 UTC
+--- rijndael.hpp.orig 2018-06-24 15:10:31 UTC
+++ rijndael.hpp
-@@ -16,6 +16,9 @@
+@@ -16,6 +16,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 +28,7 @@ class Rijndael
+@@ -25,6 +32,7 @@ class Rijndael
void keySched(byte key[_MAX_KEY_COLUMNS][4]);
void keyEncToDec();
void GenerateTables();