Skip to content
Snippets Groups Projects
Commit 32a51f6e authored by MANTANI Nobutaka's avatar MANTANI Nobutaka
Browse files

sysutils/bulk_extractor: Update to 2.0.0-beta2

parent f19da964
No related branches found
No related tags found
No related merge requests found
# Created by: MANTANI Nobutaka <nobutaka@FreeBSD.org>
PORTNAME= bulk_extractor
PORTVERSION= 1.5.5
PORTREVISION= 10
DISTVERSION= 2.0.0-beta2
CATEGORIES= sysutils
MASTER_SITES= http://digitalcorpora.org/downloads/bulk_extractor/
MASTER_SITES= https://github.com/simsong/${PORTNAME}/releases/download/v${DISTVERSION}/
MAINTAINER= nobutaka@FreeBSD.org
COMMENT= Program that scans a disk image and extracts useful information
LICENSE= GPLv3
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libafflib.so:sysutils/afflib \
libboost_system.so:devel/boost-libs \
libewf.so:devel/libewf \
libexiv2.so:graphics/exiv2 \
libexpat.so:textproc/expat2
libexpat.so:textproc/expat2 \
libgcrypt.so:security/libgcrypt \
libgpg-error.so:security/libgpg-error
USES= autoreconf compiler:c++11-lang gnome iconv:wchar_t localbase \
USES= compiler:c++17-lang gnome iconv:wchar_t localbase \
sqlite ssl
USE_GNOME= libxml2
......@@ -28,14 +29,6 @@ CXXFLAGS_powerpcspe= -DBIG_ENDIAN
CXXFLAGS_powerpc64= -DBIG_ENDIAN
CONFIGURE_ARGS= --enable-exiv2=true
PLIST_FILES= bin/bulk_extractor bin/plugin_test man/man1/bulk_extractor.1.gz
OPTIONS_DEFINE= BEVIEWER
BEVIEWER_DESC= Build BEViewer (requires Java)
OPTIONS_DEFAULT=BEVIEWER
BEVIEWER_CONFIGURE_OFF= --disable-BEViewer
BEVIEWER_USE= JAVA=yes
BEVIEWER_PLIST_FILES= bin/BEViewer bin/BEViewer.jar
PLIST_FILES= bin/bulk_extractor bin/test_be man/man1/bulk_extractor.1.gz
.include <bsd.port.mk>
SHA256 (bulk_extractor-1.5.5.tar.gz) = 297a57808c12b81b8e0d82222cf57245ad988804ab467eb0a70cf8669594e8ed
SIZE (bulk_extractor-1.5.5.tar.gz) = 4473107
TIMESTAMP = 1635429172
SHA256 (bulk_extractor-2.0.0-beta2.tar.gz) = ef5e37f63d0a9373432659a73ca269b340005e2fedbc6b1e28cb98dbd0ff3fc1
SIZE (bulk_extractor-2.0.0-beta2.tar.gz) = 5603695
--- plugins/dfxml/src/dfxml_configure.m4.orig 2014-09-16 18:34:02 UTC
+++ plugins/dfxml/src/dfxml_configure.m4
@@ -59,4 +59,5 @@ AC_CHECK_LIB([crypto],[EVP_get_digestbyn
AC_CHECK_LIB([ssl],[SSL_library_init])
AC_CHECK_FUNCS([EVP_get_digestbyname],,
AC_MSG_ERROR([SSL/OpenSSL support required]))
+AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free])
--- plugins/dfxml/src/hash_t.h.orig 2014-09-16 18:34:02 UTC
+++ plugins/dfxml/src/hash_t.h
@@ -189,7 +189,8 @@ inline std::string digest_name<sha512_t>
template<const EVP_MD *md(),size_t SIZE>
class hash_generator__ { /* generates the hash */
- EVP_MD_CTX mdctx; /* the context for computing the value */
+ private:
+ EVP_MD_CTX* mdctx; /* the context for computing the value */
bool initialized; /* has the context been initialized? */
bool finalized;
/* Static function to determine if something is zero */
@@ -199,24 +200,36 @@ class hash_generator__ { /* generates
}
return true;
}
+ /* 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 */
+ hash_generator__ & operator=(const hash_generator__ &);
+ hash_generator__(const hash_generator__ &);
public:
int64_t hashed_bytes;
/* This function takes advantage of the fact that different hash functions produce residues with different sizes */
- hash_generator__():mdctx(),initialized(false),finalized(false),hashed_bytes(0){ }
+ hash_generator__():mdctx(NULL),initialized(false),finalized(false),hashed_bytes(0){ }
~hash_generator__(){
release();
}
void release(){ /* free allocated memory */
if(initialized){
- EVP_MD_CTX_cleanup(&mdctx);
+#ifdef HAVE_EVP_MD_CTX_FREE
+ EVP_MD_CTX_free(mdctx);
+#else
+ EVP_MD_CTX_destroy(mdctx);
+#endif
initialized = false;
hashed_bytes = 0;
}
}
void init(){
if(initialized==false){
- EVP_MD_CTX_init(&mdctx);
- EVP_DigestInit_ex(&mdctx, md(), NULL);
+#ifdef HAVE_EVP_MD_CTX_NEW
+ mdctx = EVP_MD_CTX_new();
+#else
+ mdctx = EVP_MD_CTX_create();
+#endif
+ if (!mdctx) throw std::bad_alloc();
+ EVP_DigestInit_ex(mdctx, md(), NULL);
initialized = true;
finalized = false;
hashed_bytes = 0;
@@ -228,21 +241,21 @@ public:
std::cerr << "hashgen_t::update called after finalized\n";
exit(1);
}
- EVP_DigestUpdate(&mdctx,buf,bufsize);
+ EVP_DigestUpdate(mdctx,buf,bufsize);
hashed_bytes += bufsize;
}
hash__<md,SIZE> final() {
if(finalized){
std::cerr << "currently friendly_geneator does not cache the final value\n";
assert(0);
- /* code below will never be executed after assert(0) */
+ exit(1); // in case compiled with assertions disabled
}
if(!initialized){
init(); /* do it now! */
}
hash__<md,SIZE> val;
unsigned int len = sizeof(val.digest);
- EVP_DigestFinal(&mdctx,val.digest,&len);
+ EVP_DigestFinal(mdctx,val.digest,&len);
finalized = true;
return val;
}
--- src/dfxml/src/dfxml_writer.cpp.orig 2014-09-16 18:34:02 UTC
+++ src/dfxml/src/dfxml_writer.cpp
@@ -646,6 +646,7 @@ void dfxml_writer::xmlout(const string &tag,const stri
#include <exiv2/image.hpp>
#include <exiv2/exif.hpp>
#include <exiv2/error.hpp>
+#include <exiv2/exiv2.hpp>
#endif
#ifdef HAVE_HASHDB
@@ -653,7 +654,7 @@ void dfxml_writer::xmlout(const string &tag,const stri
#endif
#ifdef HAVE_AFFLIB_AFFLIB_H
-//#pragma GCC diagnostic ignored "-Wreserved-user-defined-literal" // required for C11
+#pragma GCC diagnostic ignored "-Wreserved-user-defined-literal" // required for C11
#include <afflib/afflib.h>
#endif
--- src/image_process.h.orig 2014-08-06 23:40:34.000000000 +0900
+++ src/image_process.h 2014-08-06 23:40:05.000000000 +0900
@@ -157,7 +157,7 @@
****************************************************************/
#ifdef HAVE_LIBAFFLIB
-//#pragma GCC diagnostic ignored "-Wreserved-user-defined-literal" // required for C11
+#pragma GCC diagnostic ignored "-Wreserved-user-defined-literal" // required for C11
#include <afflib/afflib.h>
#include <vector>
class process_aff : public image_process {
--- ./src/scan_exiv2.cpp.orig 2013-08-18 16:39:17.000000000 +0000
+++ ./src/scan_exiv2.cpp 2013-10-19 13:09:32.000000000 +0000
@@ -68,7 +68,7 @@
* Used for helping to convert libexiv2's GPS format to decimal lat/long
*/
-static double stod(string s)
+static double be13stod(string s)
{
double d=0;
sscanf(s.c_str(),"%lf",&d);
@@ -78,9 +78,9 @@
static double rational(string s)
{
std::vector<std::string> parts = split(s,'/');
- if(parts.size()!=2) return stod(s); // no slash, so return without
- double top = stod(parts[0]);
- double bot = stod(parts[1]);
+ if(parts.size()!=2) return be13stod(s); // no slash, so return without
+ double top = be13stod(parts[0]);
+ double bot = be13stod(parts[1]);
return bot>0 ? top / bot : top;
}
--- src/dfxml/src/dfxml_configure.m4.orig 2018-10-10 21:44:10 UTC
+++ src/dfxml/src/dfxml_configure.m4
@@ -59,4 +59,5 @@ AC_CHECK_LIB([crypto],[EVP_get_digestbyn
AC_CHECK_LIB([ssl],[SSL_library_init])
AC_CHECK_FUNCS([EVP_get_digestbyname],,
AC_MSG_ERROR([SSL/OpenSSL support required]))
+AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free])
--- src/dfxml/src/hash_t.h.orig 2014-09-16 18:34:02 UTC
+++ src/dfxml/src/hash_t.h
@@ -189,7 +189,8 @@ inline std::string digest_name<sha512_t>
template<const EVP_MD *md(),size_t SIZE>
class hash_generator__ { /* generates the hash */
- EVP_MD_CTX mdctx; /* the context for computing the value */
+ private:
+ EVP_MD_CTX* mdctx; /* the context for computing the value */
bool initialized; /* has the context been initialized? */
bool finalized;
/* Static function to determine if something is zero */
@@ -199,24 +200,36 @@ class hash_generator__ { /* generates
}
return true;
}
+ /* 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 */
+ hash_generator__ & operator=(const hash_generator__ &);
+ hash_generator__(const hash_generator__ &);
public:
int64_t hashed_bytes;
/* This function takes advantage of the fact that different hash functions produce residues with different sizes */
- hash_generator__():mdctx(),initialized(false),finalized(false),hashed_bytes(0){ }
+ hash_generator__():mdctx(NULL),initialized(false),finalized(false),hashed_bytes(0){ }
~hash_generator__(){
release();
}
void release(){ /* free allocated memory */
if(initialized){
- EVP_MD_CTX_cleanup(&mdctx);
+#ifdef HAVE_EVP_MD_CTX_FREE
+ EVP_MD_CTX_free(mdctx);
+#else
+ EVP_MD_CTX_destroy(mdctx);
+#endif
initialized = false;
hashed_bytes = 0;
}
}
void init(){
if(initialized==false){
- EVP_MD_CTX_init(&mdctx);
- EVP_DigestInit_ex(&mdctx, md(), NULL);
+#ifdef HAVE_EVP_MD_CTX_NEW
+ mdctx = EVP_MD_CTX_new();
+#else
+ mdctx = EVP_MD_CTX_create();
+#endif
+ if (!mdctx) throw std::bad_alloc();
+ EVP_DigestInit_ex(mdctx, md(), NULL);
initialized = true;
finalized = false;
hashed_bytes = 0;
@@ -228,21 +241,21 @@ public:
std::cerr << "hashgen_t::update called after finalized\n";
exit(1);
}
- EVP_DigestUpdate(&mdctx,buf,bufsize);
+ EVP_DigestUpdate(mdctx,buf,bufsize);
hashed_bytes += bufsize;
}
hash__<md,SIZE> final() {
if(finalized){
std::cerr << "currently friendly_geneator does not cache the final value\n";
assert(0);
- /* code below will never be executed after assert(0) */
+ exit(1); // in case compiled with assertions disabled
}
if(!initialized){
init(); /* do it now! */
}
hash__<md,SIZE> val;
unsigned int len = sizeof(val.digest);
- EVP_DigestFinal(&mdctx,val.digest,&len);
+ EVP_DigestFinal(mdctx,val.digest,&len);
finalized = true;
return val;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment