View | Details | Raw Unified | Return to bug 232211
Collapse All | Expand All

(-)security/pev/Makefile (+1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	pev
4
PORTNAME=	pev
5
PORTVERSION=	0.80
5
PORTVERSION=	0.80
6
PORTREVISION=	1
6
CATEGORIES=	security
7
CATEGORIES=	security
7
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-${PORTVERSION}/
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-${PORTVERSION}/
8
9
(-)security/pev/files/patch-pehash (+48 lines)
Line 0 Link Here
1
From 98f5f22f91f02821be1604bbce61efb45f7e3696 Mon Sep 17 00:00:00 2001
2
From: Jardel Weyrich <jweyrich@gmail.com>
3
Date: Thu, 12 Jan 2017 16:45:24 -0200
4
Subject: [PATCH] Make pehash compatible with OpenSSL 1.1.0.
5
6
---
7
 src/pehash.c | 24 ++++++++++++++++++------
8
 1 file changed, 18 insertions(+), 6 deletions(-)
9
10
diff --git src/pehash.c src/pehash.c
11
index e03a0a9..619a1ef 100644
12
--- src/pehash.c
13
+++ src/pehash.c
14
@@ -215,13 +215,25 @@ static void calc_hash(const char *alg_name, const unsigned char *data, size_t si
15
 	unsigned char md_value[EVP_MAX_MD_SIZE];
16
 	unsigned int md_len;
17
 
18
-	EVP_MD_CTX md_ctx;
19
+// See https://wiki.openssl.org/index.php/1.1_API_Changes
20
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
21
+	EVP_MD_CTX md_ctx_auto;
22
+	EVP_MD_CTX *md_ctx = &md_ctx_auto;
23
+#else
24
+	EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
25
+#endif
26
+
27
 	// FIXME: Handle errors - Check return values.
28
-	EVP_MD_CTX_init(&md_ctx);
29
-	EVP_DigestInit_ex(&md_ctx, md, NULL);
30
-	EVP_DigestUpdate(&md_ctx, data, size);
31
-	EVP_DigestFinal_ex(&md_ctx, md_value, &md_len);
32
-	EVP_MD_CTX_cleanup(&md_ctx);
33
+	EVP_MD_CTX_init(md_ctx);
34
+	EVP_DigestInit_ex(md_ctx, md, NULL);
35
+	EVP_DigestUpdate(md_ctx, data, size);
36
+	EVP_DigestFinal_ex(md_ctx, md_value, &md_len);
37
+
38
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
39
+	EVP_MD_CTX_cleanup(md_ctx);
40
+#else
41
+	EVP_MD_CTX_free(md_ctx);
42
+#endif
43
 
44
 	for (unsigned int i=0; i < md_len; i++)
45
 		sprintf(&output[i * 2], "%02x", md_value[i]);
46
-- 
47
2.15.1
48
(-)security/pev/files/patch-pesec (+26 lines)
Line 0 Link Here
1
From 3fc1d6ac863cfb596e8e9263e03871aec8c00d22 Mon Sep 17 00:00:00 2001
2
From: Jardel Weyrich <jweyrich@gmail.com>
3
Date: Thu, 19 Jan 2017 00:14:31 -0200
4
Subject: [PATCH] Make pesec compatible with OpenSSL 1.1.0.
5
6
---
7
 src/pesec.c | 2 ++
8
 1 file changed, 2 insertions(+)
9
10
diff --git src/pesec.c src/pesec.c
11
index 470af17..a10f963 100644
12
--- src/pesec.c
13
+++ src/pesec.c
14
@@ -225,7 +225,9 @@ static int parse_pkcs7_data(const options_t *options, const CRYPT_DATA_BLOB *blo
15
 	PKCS7 *p7 = NULL;
16
 	BIO *in = NULL;
17
 
18
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
19
 	CRYPTO_malloc_init();
20
+#endif
21
 	ERR_load_crypto_strings();
22
 	OpenSSL_add_all_algorithms();
23
 
24
-- 
25
2.15.1
26

Return to bug 232211