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

(-)sysutils/bulk_extractor/Makefile (-2 / +2 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	bulk_extractor
4
PORTNAME=	bulk_extractor
5
PORTVERSION=	1.5.5
5
PORTVERSION=	1.5.5
6
PORTREVISION=	2
6
PORTREVISION=	3
7
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
8
MASTER_SITES=	http://digitalcorpora.org/downloads/bulk_extractor/
8
MASTER_SITES=	http://digitalcorpora.org/downloads/bulk_extractor/
9
9
Lines 13-19 Link Here
13
LICENSE=	GPLv3
13
LICENSE=	GPLv3
14
LICENSE_FILE=	${WRKSRC}/COPYING
14
LICENSE_FILE=	${WRKSRC}/COPYING
15
15
16
USES=		sqlite ssl
16
USES=		autoreconf sqlite ssl
17
LIB_DEPENDS=	libafflib.so:sysutils/afflib \
17
LIB_DEPENDS=	libafflib.so:sysutils/afflib \
18
		libewf.so:devel/libewf \
18
		libewf.so:devel/libewf \
19
		libexiv2.so:graphics/exiv2 \
19
		libexiv2.so:graphics/exiv2 \
(-)sysutils/bulk_extractor/files/patch-plugins_dfxml_src_dfxml__configure.m4 (+8 lines)
Line 0 Link Here
1
--- plugins/dfxml/src/dfxml_configure.m4.orig	2014-09-16 18:34:02 UTC
2
+++ plugins/dfxml/src/dfxml_configure.m4
3
@@ -59,4 +59,5 @@ AC_CHECK_LIB([crypto],[EVP_get_digestbyn
4
 AC_CHECK_LIB([ssl],[SSL_library_init])
5
 AC_CHECK_FUNCS([EVP_get_digestbyname],,
6
 	AC_MSG_ERROR([SSL/OpenSSL support required]))
7
+AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free])
8
 
(-)sysutils/bulk_extractor/files/patch-plugins_dfxml_src_hash__t.h (+78 lines)
Line 0 Link Here
1
--- plugins/dfxml/src/hash_t.h.orig	2014-09-16 18:34:02 UTC
2
+++ plugins/dfxml/src/hash_t.h
3
@@ -189,7 +189,8 @@ inline std::string digest_name<sha512_t>
4
 
5
 template<const EVP_MD *md(),size_t SIZE> 
6
 class hash_generator__ { 			/* generates the hash */
7
-    EVP_MD_CTX mdctx;	     /* the context for computing the value */
8
+ private:
9
+    EVP_MD_CTX* mdctx;	     /* the context for computing the value */
10
     bool initialized;	       /* has the context been initialized? */
11
     bool finalized;
12
     /* Static function to determine if something is zero */
13
@@ -199,24 +200,36 @@ class hash_generator__ { 			/* generates
14
 	}
15
 	return true;
16
     }
17
+    /* Not allowed to copy; these are prototyped but not defined, so any attempt to use them will fail, but we won't get the -Weffc++ warnings  */
18
+    hash_generator__ & operator=(const hash_generator__ &);
19
+    hash_generator__(const hash_generator__ &);
20
 public:
21
     int64_t hashed_bytes;
22
     /* This function takes advantage of the fact that different hash functions produce residues with different sizes */
23
-    hash_generator__():mdctx(),initialized(false),finalized(false),hashed_bytes(0){ }
24
+    hash_generator__():mdctx(NULL),initialized(false),finalized(false),hashed_bytes(0){ }
25
     ~hash_generator__(){
26
 	release();
27
     }
28
     void release(){			/* free allocated memory */
29
 	if(initialized){
30
-	    EVP_MD_CTX_cleanup(&mdctx);
31
+#ifdef HAVE_EVP_MD_CTX_FREE
32
+	    EVP_MD_CTX_free(mdctx);
33
+#else
34
+	    EVP_MD_CTX_destroy(mdctx);
35
+#endif
36
 	    initialized = false;
37
 	    hashed_bytes = 0;
38
 	}
39
     }
40
     void init(){
41
 	if(initialized==false){
42
-	    EVP_MD_CTX_init(&mdctx);
43
-	    EVP_DigestInit_ex(&mdctx, md(), NULL);
44
+#ifdef HAVE_EVP_MD_CTX_NEW
45
+	    mdctx = EVP_MD_CTX_new();
46
+#else
47
+	    mdctx = EVP_MD_CTX_create();
48
+#endif
49
+            if (!mdctx) throw std::bad_alloc();
50
+	    EVP_DigestInit_ex(mdctx, md(), NULL);
51
 	    initialized = true;
52
 	    finalized = false;
53
 	    hashed_bytes = 0;
54
@@ -228,21 +241,21 @@ public:
55
 	    std::cerr << "hashgen_t::update called after finalized\n";
56
 	    exit(1);
57
 	}
58
-	EVP_DigestUpdate(&mdctx,buf,bufsize);
59
+	EVP_DigestUpdate(mdctx,buf,bufsize);
60
 	hashed_bytes += bufsize;
61
     }
62
     hash__<md,SIZE> final() {
63
 	if(finalized){
64
 	  std::cerr << "currently friendly_geneator does not cache the final value\n";
65
 	  assert(0);
66
-	  /* code below will never be executed after assert(0) */
67
+          exit(1);                      // in case compiled with assertions disabled
68
 	}
69
 	if(!initialized){
70
 	  init();			/* do it now! */
71
 	}
72
 	hash__<md,SIZE> val;
73
 	unsigned int len = sizeof(val.digest);
74
-	EVP_DigestFinal(&mdctx,val.digest,&len);
75
+	EVP_DigestFinal(mdctx,val.digest,&len);
76
 	finalized = true;
77
 	return val;
78
     }
(-)sysutils/bulk_extractor/files/patch-src_dfxml_src_dfxml__configure.m4 (+8 lines)
Line 0 Link Here
1
--- src/dfxml/src/dfxml_configure.m4.orig	2018-10-10 21:44:10 UTC
2
+++ src/dfxml/src/dfxml_configure.m4
3
@@ -59,4 +59,5 @@ AC_CHECK_LIB([crypto],[EVP_get_digestbyn
4
 AC_CHECK_LIB([ssl],[SSL_library_init])
5
 AC_CHECK_FUNCS([EVP_get_digestbyname],,
6
 	AC_MSG_ERROR([SSL/OpenSSL support required]))
7
+AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free])
8
 
(-)sysutils/bulk_extractor/files/patch-src_dfxml_src_hash__t.h (+78 lines)
Line 0 Link Here
1
--- src/dfxml/src/hash_t.h.orig	2014-09-16 18:34:02 UTC
2
+++ src/dfxml/src/hash_t.h
3
@@ -189,7 +189,8 @@ inline std::string digest_name<sha512_t>
4
 
5
 template<const EVP_MD *md(),size_t SIZE> 
6
 class hash_generator__ { 			/* generates the hash */
7
-    EVP_MD_CTX mdctx;	     /* the context for computing the value */
8
+ private:
9
+    EVP_MD_CTX* mdctx;	     /* the context for computing the value */
10
     bool initialized;	       /* has the context been initialized? */
11
     bool finalized;
12
     /* Static function to determine if something is zero */
13
@@ -199,24 +200,36 @@ class hash_generator__ { 			/* generates
14
 	}
15
 	return true;
16
     }
17
+    /* Not allowed to copy; these are prototyped but not defined, so any attempt to use them will fail, but we won't get the -Weffc++ warnings  */
18
+    hash_generator__ & operator=(const hash_generator__ &);
19
+    hash_generator__(const hash_generator__ &);
20
 public:
21
     int64_t hashed_bytes;
22
     /* This function takes advantage of the fact that different hash functions produce residues with different sizes */
23
-    hash_generator__():mdctx(),initialized(false),finalized(false),hashed_bytes(0){ }
24
+    hash_generator__():mdctx(NULL),initialized(false),finalized(false),hashed_bytes(0){ }
25
     ~hash_generator__(){
26
 	release();
27
     }
28
     void release(){			/* free allocated memory */
29
 	if(initialized){
30
-	    EVP_MD_CTX_cleanup(&mdctx);
31
+#ifdef HAVE_EVP_MD_CTX_FREE
32
+	    EVP_MD_CTX_free(mdctx);
33
+#else
34
+	    EVP_MD_CTX_destroy(mdctx);
35
+#endif
36
 	    initialized = false;
37
 	    hashed_bytes = 0;
38
 	}
39
     }
40
     void init(){
41
 	if(initialized==false){
42
-	    EVP_MD_CTX_init(&mdctx);
43
-	    EVP_DigestInit_ex(&mdctx, md(), NULL);
44
+#ifdef HAVE_EVP_MD_CTX_NEW
45
+	    mdctx = EVP_MD_CTX_new();
46
+#else
47
+	    mdctx = EVP_MD_CTX_create();
48
+#endif
49
+            if (!mdctx) throw std::bad_alloc();
50
+	    EVP_DigestInit_ex(mdctx, md(), NULL);
51
 	    initialized = true;
52
 	    finalized = false;
53
 	    hashed_bytes = 0;
54
@@ -228,21 +241,21 @@ public:
55
 	    std::cerr << "hashgen_t::update called after finalized\n";
56
 	    exit(1);
57
 	}
58
-	EVP_DigestUpdate(&mdctx,buf,bufsize);
59
+	EVP_DigestUpdate(mdctx,buf,bufsize);
60
 	hashed_bytes += bufsize;
61
     }
62
     hash__<md,SIZE> final() {
63
 	if(finalized){
64
 	  std::cerr << "currently friendly_geneator does not cache the final value\n";
65
 	  assert(0);
66
-	  /* code below will never be executed after assert(0) */
67
+          exit(1);                      // in case compiled with assertions disabled
68
 	}
69
 	if(!initialized){
70
 	  init();			/* do it now! */
71
 	}
72
 	hash__<md,SIZE> val;
73
 	unsigned int len = sizeof(val.digest);
74
-	EVP_DigestFinal(&mdctx,val.digest,&len);
75
+	EVP_DigestFinal(mdctx,val.digest,&len);
76
 	finalized = true;
77
 	return val;
78
     }

Return to bug 232164