[Forensics-changes] [afflib] 01/02: Imported Upstream version 3.7.13
Joao Eriberto Mota Filho
eriberto at moszumanska.debian.org
Sun Dec 4 19:12:05 UTC 2016
This is an automated email from the git hooks/post-receive script.
eriberto pushed a commit to branch debian
in repository afflib.
commit 6b8e5ccf90c9b97c5f12e2e796c51499c2d75007
Author: Joao Eriberto Mota Filho <eriberto at debian.org>
Date: Sun Dec 4 17:11:33 2016 -0200
Imported Upstream version 3.7.13
---
.gitignore | 1 +
README | 2 +-
compile | 136 ------------------------------------------------------
configure.ac | 116 +++++++++++++++++++++++++---------------------
lib/afflib.cpp | 4 +-
lib/aftest.cpp | 2 +-
lib/crypto.cpp | 5 +-
tools/affcopy.cpp | 2 +-
tools/affix.cpp | 2 +-
tools/affsign.cpp | 2 +-
win32/affconfig.h | 2 +-
11 files changed, 74 insertions(+), 200 deletions(-)
diff --git a/.gitignore b/.gitignore
index c4f7161..78e3ca5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,3 +105,4 @@ affconfig.h
*.dirstamp
lib/aftest
afflib-?.?.?
+compile
diff --git a/README b/README
index e79b550..4b04af7 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
2005-2006 Basis Technology, Inc.
2005-2013 Simson L. Garfinkel <simsong at acm.org>
- 2014 Phillip Hellewell <sshock at gmail.com>
+ 2014-2016 Phillip Hellewell <sshock at gmail.com>
The Advanced Forensic Format (AFF) is on-disk format for storing
computer forensic information. Critical features of AFF include:
diff --git a/compile b/compile
deleted file mode 100755
index a81e000..0000000
--- a/compile
+++ /dev/null
@@ -1,136 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
-
-scriptversion=2003-11-09.00
-
-# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey at cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake at gnu.org> or send patches to
-# <automake-patches at gnu.org>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
-
-Report bugs to <bug-automake at gnu.org>.
-EOF
- exit 0
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit 0
- ;;
-esac
-
-
-prog=$1
-shift
-
-ofile=
-cfile=
-args=
-while test $# -gt 0; do
- case "$1" in
- -o)
- # configure might choose to run compile as `compile cc -o foo foo.c'.
- # So we do something ugly here.
- ofile=$2
- shift
- case "$ofile" in
- *.o | *.obj)
- ;;
- *)
- args="$args -o $ofile"
- ofile=
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- args="$args $1"
- ;;
- *)
- args="$args $1"
- ;;
- esac
- shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
- # If no `-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # `.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$prog" $args
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use `[/.-]' here to ensure that we don't use the same name
-# that we are using for the .o file. Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
-while true; do
- if mkdir $lockdir > /dev/null 2>&1; then
- break
- fi
- sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir $lockdir; exit 1" 1 2 15
-
-# Run the compile.
-"$prog" $args
-status=$?
-
-if test -f "$cofile"; then
- mv "$cofile" "$ofile"
-fi
-
-rmdir $lockdir
-exit $status
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/configure.ac b/configure.ac
index 7de2900..db06019 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
# See http://autotoolset.sourceforge.net/tutorial.html
# and http://www.openismus.com/documents/linux/automake/automake.shtml
-AC_INIT([AFFLIB],[3.7.10],[https://github.com/sshock/AFFLIBv3])
+AC_INIT([AFFLIB],[3.7.13],[https://github.com/sshock/AFFLIBv3])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
@@ -34,11 +34,11 @@ ACX_PTHREAD()
if test x"${cross_compiling}" = "xno" ; then
# Bring additional directories where things might be found into our
# search path. I don't know why autoconf doesn't do this by default
- for spfx in /usr/local /opt/local /sw ${prefix} ; do
+ for spfx in ${prefix} /sw /opt/local /usr/local ; do
AC_MSG_NOTICE([checking ${spfx}/include])
if test -d ${spfx}/include; then
- CPPFLAGS="-I${spfx}/include $CPPFLAGS"
- LDFLAGS="-L${spfx}/lib $LDFLAGS"
+ CPPFLAGS="$CPPFLAGS -I${spfx}/include"
+ LDFLAGS="$LDFLAGS -L${spfx}/lib"
AC_MSG_NOTICE([ *** ADDING ${spfx}/include to CPPFLAGS *** ])
AC_MSG_NOTICE([ *** ADDING ${spfx}/lib to LDFLAGS *** ])
fi
@@ -120,43 +120,50 @@ AC_CHECK_LIB([rt],[aio_error64])
################################################################
## Expat
## Required for S3 and Digital Signatures
-##
-AC_ARG_WITH(expat,
- AS_HELP_STRING([--with-expat=PATH], [where libexpat is compiled (if it isn't installed); required for S3 and Digital Signatures]),
- [LDFLAGS="-L${with_expat} $LDFLAGS" ;
- CPPFLAGS="-I${with_expat}/lib $CPPFLAGS"])
-
-have_expat=yes
-AC_CHECK_HEADER([expat.h])
-AC_CHECK_LIB([expat],[XML_ParserCreate],,[have_expat="no ";AC_MSG_WARN([expat not found; S3 and Digital Signatures not enabled])])
-
+AC_ARG_WITH([expat],
+ AS_HELP_STRING([--with-expat], [build with expat; required for S3 and Digital Signatures @<:@default=check@:>@]),
+ [], [with_expat=check])
+
+have_expat=no
+AS_IF([test "x$with_expat" != xno],
+ [AC_CHECK_HEADER([expat.h],
+ [AC_CHECK_LIB([expat], [XML_ParserCreate])])
+ have_expat=${ac_cv_lib_expat_XML_ParserCreate-no}
+ AS_IF([test "x$with_expat" != xcheck && test "x$have_expat" = xno],
+ [AC_MSG_FAILURE([--with-expat was given but test for expat failed])])])
################################################################
## LZMA (always enabled)
AC_DEFINE(USE_LZMA, 1, [Enable LZMA compression])
+################################################################
+## curl
+## Required for S3
+AC_ARG_WITH([curl],
+ AS_HELP_STRING([--with-curl], [build with curl; required for S3 @<:@default=check@:>@]),
+ [], [with_curl=check])
+
+have_curl=no
+AS_IF([test "x$with_curl" != xno],
+ [AC_CHECK_HEADER([curl/curl.h],
+ [AC_CHECK_LIB([curl], [curl_global_init],,)],)
+ have_curl=${ac_cv_lib_curl_curl_global_init-no}
+ AS_IF([test "x$with_curl" != xcheck && test "x$have_curl" = xno],
+ [AC_MSG_FAILURE([--with-curl was given but test for curl failed])])])
################################################################
## Amazon S3
## S3 requires curl and expat; otherwise we don't need them
-AC_ARG_ENABLE(s3,
- AC_HELP_STRING([--enable-s3=yes],
- [Support for Amazon S3 service. Requires CURL and Expat.]),
- [enable_s3=$enableval], [enable_s3=no])
+AC_ARG_ENABLE([s3],
+ AC_HELP_STRING([--enable-s3], [Support for Amazon S3 service. Requires CURL and Expat. @<:@default=check@:>@]),
+ [enable_s3=$enableval], [enable_s3=check])
-if test "x${enable_s3}" = "xyes" ; then
- AC_MSG_NOTICE([S3 support requested. Looking for curl and expat...])
- AC_PATH_PROG(CURL_CONFIG,curl-config)
- AC_ARG_WITH(curl,
- AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed; required for S3]),
- [CURL_CONFIG="${with_curl}/bin/curl-config"])
- AC_CHECK_HEADER([curl/curl.h],,
- AC_MSG_WARN([curl/curl.h not found; Disabling S3 Support.])
- enable_s3=no)
- AC_CHECK_LIB([curl],[curl_global_init],,
- AC_MSG_WARN([Curl library corrupt; Disabling S3 Support.])
- enable_s3=no)
-fi
+AS_IF([test "x$enable_s3" != xno],
+ [AS_IF([test "x$have_expat" = xyes && test "x$have_curl" = xyes],
+ [enable_s3=yes],
+ [AS_IF([test "x$enable_s3" = xcheck],
+ [enable_s3=no],
+ [AC_MSG_FAILURE([--enable-s3 was given but required libraries are not found])])])])
S3_BIN=
if test "x${enable_s3}" = "xyes" ; then
@@ -226,34 +233,37 @@ AC_CHECK_LIB([crypto],[EVP_get_digestbyname],,
AC_CHECK_LIB([md],[MD5]) # if libmd is available, get it
-AC_CHECK_FUNCS([MD5 SHA1 AES_encrypt RAND_pseudo_bytes des_read_pw_string EVP_read_pw_string EVP_MD_size])
+AC_CHECK_FUNCS([MD5 SHA1 AES_encrypt RAND_bytes des_read_pw_string EVP_read_pw_string EVP_MD_size])
AC_CHECK_FUNCS([PEM_read_bio_RSA_PUBKEY])
################################################################
## FUSE: Filesystem in Userspace
AC_ARG_ENABLE(fuse,
- AC_HELP_STRING([--enable-fuse=yes],
- [Support for FUSE, Filesystem in Userspace. (default yes)]),
- [enable_fuse=$enableval], [enable_fuse=yes])
-if test "x${enable_fuse}" = "xyes" ; then
- AC_MSG_NOTICE([FUSE requested])
- CPPFLAGS="-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 $CPPFLAGS"
- if test `uname -s` = Darwin ; then
- AC_MSG_NOTICE([FUSE IS NOT SUPPORTED ON MACOS])
- enable_fuse=no
- fi
- AC_CHECK_HEADER([fuse.h],,
- AC_MSG_NOTICE([fuse.h not found; Disabling FUSE support.])
- enable_fuse=no)
- AC_SUBST(FUSE_LIBS)
- AC_SUBST(FUSE_CFLAGS)
-fi
+ AC_HELP_STRING([--enable-fuse], [Support for FUSE, Filesystem in Userspace. @<:@default=check@:>@]),
+ [enable_fuse=$enableval], [enable_fuse=check])
+
+have_fuse=no
+AS_IF([test "x$enable_fuse" != xno],
+ [CPPFLAGS="-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 $CPPFLAGS"
+ AC_CHECK_HEADER([fuse.h],
+ [AC_CHECK_LIB([fuse], [fuse_version],
+ [FUSE_LIBS=-lfuse
+ have_fuse=yes])])
+ AS_IF([test `uname -s` = Darwin && test "x$have_fuse" != "xyes"],
+ [m4_ifdef([PKG_CHECK_MODULES],
+ [PKG_CHECK_MODULES([FUSE], [fuse],
+ [have_fuse=yes],
+ [:])])])
+ AS_IF([test "x$enable_fuse" != xcheck && test "x$have_fuse" = xno],
+ [AC_MSG_FAILURE([--enable-fuse was given but test for fuse failed])])])
+enable_fuse=$have_fuse
+
AFFUSE_BIN=
-if test "${enable_fuse}" = "yes"; then
- AC_DEFINE([USE_FUSE],1,[Use FUSE to mount AFF images])
- AFFUSE_BIN='affuse$(EXEEXT)'
- FUSE_LIBS=-lfuse
-fi
+AS_IF([test "x${enable_fuse}" = "xyes"],
+ [AC_SUBST(FUSE_LIBS)
+ AC_SUBST(FUSE_CFLAGS)
+ AC_DEFINE([USE_FUSE],1,[Use FUSE to mount AFF images])
+ AFFUSE_BIN='affuse$(EXEEXT)'])
AC_SUBST(AFFUSE_BIN)
AM_PROG_CC_C_O dnl for affuse
##
diff --git a/lib/afflib.cpp b/lib/afflib.cpp
index 4baa820..cc56791 100644
--- a/lib/afflib.cpp
+++ b/lib/afflib.cpp
@@ -596,7 +596,7 @@ int af_make_badflag(AFFILE *af)
if(af->badflag!=0) free(af->badflag);
af->badflag = (unsigned char *)malloc(af->image_sectorsize); // current sector size
- RAND_pseudo_bytes(af->badflag,af->image_sectorsize);
+ RAND_bytes(af->badflag,af->image_sectorsize);
strcpy((char *)af->badflag,"BAD SECTOR");
AF_WRLOCK(af);
@@ -624,7 +624,7 @@ int af_make_gid(AFFILE *af)
AF_WRLOCK(af);
if(af_get_seg(af,AF_IMAGE_GID,0,0,0)!=0){
unsigned char bit128[16];
- RAND_pseudo_bytes(bit128,sizeof(bit128));
+ RAND_bytes(bit128,sizeof(bit128));
int r = af_update_seg(af,AF_IMAGE_GID,0,bit128,sizeof(bit128));
if(r<0) ret = -1;
else ret = 1;
diff --git a/lib/aftest.cpp b/lib/aftest.cpp
index ef733c9..d8f00bb 100644
--- a/lib/aftest.cpp
+++ b/lib/aftest.cpp
@@ -238,7 +238,7 @@ int random_read_test(int total_bytes,int data_page_size)
unsigned char *buf2 = (unsigned char *)malloc(total_bytes);
/* First half is random */
- RAND_pseudo_bytes(buf,total_bytes/2);
+ RAND_bytes(buf,total_bytes/2);
/* Second half is a bit more predictable */
for(int i=total_bytes/2;i<total_bytes;i++){
diff --git a/lib/crypto.cpp b/lib/crypto.cpp
index 42dce9a..2779f0e 100644
--- a/lib/crypto.cpp
+++ b/lib/crypto.cpp
@@ -297,7 +297,6 @@ int af_establish_aes_passphrase(AFFILE *af,const char *passphrase)
/* Okay; make a random key and encrypt it with the passphrase */
unsigned char affkey[32];
int r = RAND_bytes(affkey,sizeof(affkey)); // makes a random key; with REAL random bytes
- if(r!=1) r = RAND_pseudo_bytes(affkey,sizeof(affkey)); // true random not supported
if(r!=1) return AF_ERROR_RNG_FAIL; // pretty bad...
/* I have the key, now save it */
@@ -777,7 +776,6 @@ int af_set_seal_certificates(AFFILE *af,const char *certfiles[],int numcertfile
/* First make the affkey */
unsigned char affkey[32];
int r = RAND_bytes(affkey,sizeof(affkey));
- if(r!=1) r = RAND_pseudo_bytes(affkey,sizeof(affkey)); // true random not supported
if(r!=1) return AF_ERROR_RNG_FAIL; // pretty bad...
af_seal_affkey_using_certificates(af, certfiles, numcertfiles, affkey);
@@ -818,7 +816,8 @@ int af_seal_affkey_using_certificates(AFFILE *af,const char *certfiles[],int nu
/* IV */
unsigned char iv[EVP_MAX_IV_LENGTH];
- RAND_pseudo_bytes(iv, EVP_MAX_IV_LENGTH); /* make a random iv */
+ r = RAND_bytes(iv, EVP_MAX_IV_LENGTH); /* make a random iv */
+ if(r!=1) return AF_ERROR_RNG_FAIL; // pretty bad...
/* EK */
unsigned char *ek=0;
diff --git a/tools/affcopy.cpp b/tools/affcopy.cpp
index 853eabb..f3091e2 100644
--- a/tools/affcopy.cpp
+++ b/tools/affcopy.cpp
@@ -367,7 +367,7 @@ int affcopy(char *infile,vector<string> &outfiles)
uint32_t arg=0;
if(af_get_seg(ain,segname,&arg,segbuf,&seglen)){
unlink_outfiles(outfiles); // failure; unlink the output files
- err(1,"Cannot read segment '%s' in %s. Deleteing output file", segname,af_filename(ain));
+ err(1,"Cannot read segment '%s' in %s. Deleting output file", segname,af_filename(ain));
}
/* Calculate the MD5 of this segment and remember it in the map */
diff --git a/tools/affix.cpp b/tools/affix.cpp
index da1050e..da76e87 100644
--- a/tools/affix.cpp
+++ b/tools/affix.cpp
@@ -169,7 +169,7 @@ int fix(const char *infile)
if(fix_add_gid) {
printf(" ... adding GID ",infile);
unsigned char bit128[16];
- RAND_pseudo_bytes(bit128,sizeof(bit128));
+ RAND_bytes(bit128,sizeof(bit128));
if(af_update_seg(af,AF_IMAGE_GID,0,bit128,sizeof(bit128))){
warn("Cannot write %s: ",AF_IMAGE_GID);
}
diff --git a/tools/affsign.cpp b/tools/affsign.cpp
index faabddd..ce5fccb 100644
--- a/tools/affsign.cpp
+++ b/tools/affsign.cpp
@@ -183,7 +183,7 @@ int affsign(const char *fn)
/* Now get the raw source segment */
uint32_t arg=0;
if(af_get_seg(af,segname,&arg,segbuf,&seglen)){
- err(1,"Cannot read segment '%s' in %s. Deleteing output file", segname,af_filename(af));
+ err(1,"Cannot read segment '%s' in %s. Deleting output file", segname,af_filename(af));
}
aff_bom::make_hash(seghash,arg,segname,segbuf,seglen);
sigmode = AF_SIGNATURE_MODE0;
diff --git a/win32/affconfig.h b/win32/affconfig.h
index 8318c33..8189437 100644
--- a/win32/affconfig.h
+++ b/win32/affconfig.h
@@ -1,6 +1,6 @@
#include <windows.h>
-#define PACKAGE_VERSION "3.7.10"
+#define PACKAGE_VERSION "3.7.13"
#undef USE_LIBEWF
#undef USE_QEMU
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/afflib.git
More information about the forensics-changes
mailing list