From owner-svn-ports-all@freebsd.org Fri Oct 12 07:35:48 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFE910A51B9; Fri, 12 Oct 2018 07:35:48 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA7E076586; Fri, 12 Oct 2018 07:35:47 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A749E1C4E4; Fri, 12 Oct 2018 07:35:47 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9C7Zlfm052628; Fri, 12 Oct 2018 07:35:47 GMT (envelope-from jhale@FreeBSD.org) Received: (from jhale@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9C7ZlgE052626; Fri, 12 Oct 2018 07:35:47 GMT (envelope-from jhale@FreeBSD.org) Message-Id: <201810120735.w9C7ZlgE052626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhale set sender to jhale@FreeBSD.org using -f From: "Jason E. Hale" Date: Fri, 12 Oct 2018 07:35:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r481881 - in head/archivers/libunrar5: . files X-SVN-Group: ports-head X-SVN-Commit-Author: jhale X-SVN-Commit-Paths: in head/archivers/libunrar5: . files X-SVN-Commit-Revision: 481881 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 07:35:48 -0000 Author: jhale Date: Fri Oct 12 07:35:46 2018 New Revision: 481881 URL: https://svnweb.freebsd.org/changeset/ports/481881 Log: Fix build with OpenSSL 1.1.x Reported by: pkg-fallout (head) Modified: head/archivers/libunrar5/Makefile head/archivers/libunrar5/files/patch-rijndael.cpp head/archivers/libunrar5/files/patch-rijndael.hpp Modified: head/archivers/libunrar5/Makefile ============================================================================== --- head/archivers/libunrar5/Makefile Fri Oct 12 07:22:46 2018 (r481880) +++ head/archivers/libunrar5/Makefile Fri Oct 12 07:35:46 2018 (r481881) @@ -36,7 +36,6 @@ 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 -OPENSSL_AES_VARS= BROKEN_SSL=openssl-devel PLIST_FILES= lib/libunrar.a \ lib/libunrar.so \ Modified: head/archivers/libunrar5/files/patch-rijndael.cpp ============================================================================== --- head/archivers/libunrar5/files/patch-rijndael.cpp Fri Oct 12 07:22:46 2018 (r481880) +++ head/archivers/libunrar5/files/patch-rijndael.cpp Fri Oct 12 07:35:46 2018 (r481881) @@ -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); } } Modified: head/archivers/libunrar5/files/patch-rijndael.hpp ============================================================================== --- head/archivers/libunrar5/files/patch-rijndael.hpp Fri Oct 12 07:22:46 2018 (r481880) +++ head/archivers/libunrar5/files/patch-rijndael.hpp Fri Oct 12 07:35:46 2018 (r481881) @@ -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();