Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2018 12:14:03 +0000 (UTC)
From:      Danilo Egea Gondolfo <danilo@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r482494 - in head/security/pev: . files
Message-ID:  <201810201214.w9KCE3Gr035379@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danilo
Date: Sat Oct 20 12:14:02 2018
New Revision: 482494
URL: https://svnweb.freebsd.org/changeset/ports/482494

Log:
  - Fix build after OpenSSL update on FreeBSD 12
  
  PR:		232211
  Submitted by:	Nathan <ndowens AT yahoo.com>

Added:
  head/security/pev/files/patch-src_pehash.c   (contents, props changed)
  head/security/pev/files/patch-src_pesec.c   (contents, props changed)
Modified:
  head/security/pev/Makefile

Modified: head/security/pev/Makefile
==============================================================================
--- head/security/pev/Makefile	Sat Oct 20 11:52:10 2018	(r482493)
+++ head/security/pev/Makefile	Sat Oct 20 12:14:02 2018	(r482494)
@@ -3,6 +3,7 @@
 
 PORTNAME=	pev
 PORTVERSION=	0.80
+PORTREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-${PORTVERSION}/
 

Added: head/security/pev/files/patch-src_pehash.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/pev/files/patch-src_pehash.c	Sat Oct 20 12:14:02 2018	(r482494)
@@ -0,0 +1,34 @@
+--- src/pehash.c.orig	2018-10-20 11:44:18 UTC
++++ src/pehash.c
+@@ -215,13 +215,25 @@ static void calc_hash(const char *alg_name, const unsi
+ 	unsigned char md_value[EVP_MAX_MD_SIZE];
+ 	unsigned int md_len;
+ 
+-	EVP_MD_CTX md_ctx;
++	// See https://wiki.openssl.org/index.php/1.1_API_Changes
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++	EVP_MD_CTX md_ctx_auto;
++	EVP_MD_CTX *md_ctx = &md_ctx_auto;
++#else
++	EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
++#endif
++
+ 	// FIXME: Handle errors - Check return values.
+-	EVP_MD_CTX_init(&md_ctx);
+-	EVP_DigestInit_ex(&md_ctx, md, NULL);
+-	EVP_DigestUpdate(&md_ctx, data, size);
+-	EVP_DigestFinal_ex(&md_ctx, md_value, &md_len);
+-	EVP_MD_CTX_cleanup(&md_ctx);
++	EVP_MD_CTX_init(md_ctx);
++	EVP_DigestInit_ex(md_ctx, md, NULL);
++	EVP_DigestUpdate(md_ctx, data, size);
++	EVP_DigestFinal_ex(md_ctx, md_value, &md_len);
++
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++	EVP_MD_CTX_cleanup(md_ctx);
++#else
++	EVP_MD_CTX_free(md_ctx);
++#endif
+ 
+ 	for (unsigned int i=0; i < md_len; i++)
+ 		sprintf(&output[i * 2], "%02x", md_value[i]);

Added: head/security/pev/files/patch-src_pesec.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/pev/files/patch-src_pesec.c	Sat Oct 20 12:14:02 2018	(r482494)
@@ -0,0 +1,12 @@
+--- src/pesec.c.orig	2018-10-20 11:48:33 UTC
++++ src/pesec.c
+@@ -225,7 +225,9 @@ static int parse_pkcs7_data(const options_t *options, 
+ 	PKCS7 *p7 = NULL;
+ 	BIO *in = NULL;
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ 	CRYPTO_malloc_init();
++#endif
+ 	ERR_load_crypto_strings();
+ 	OpenSSL_add_all_algorithms();
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810201214.w9KCE3Gr035379>