[Forensics-changes] [afflib] 01/03: Imported Upstream version 3.7.6

Joao Eriberto Mota Filho eriberto at moszumanska.debian.org
Sat Nov 8 11:06:33 UTC 2014


This is an automated email from the git hooks/post-receive script.

eriberto pushed a commit to branch debian
in repository afflib.

commit 678a5d6f2fafbfd8172a9c860a182a553d47fe48
Author: Joao Eriberto Mota Filho <eriberto at debian.org>
Date:   Sat Nov 8 09:06:09 2014 -0200

    Imported Upstream version 3.7.6
---
 configure.ac           | 18 +++++++-----------
 doc/announce_3.7.5.txt |  2 +-
 lib/afflib.cpp         |  8 --------
 lib/afflib_i.h         |  2 +-
 lib/aftest.cpp         |  6 ------
 lib/qemu/block-vvfat.c |  8 +++++---
 lib/qemu/qemu-common.h |  4 ++++
 lib/s3_glue.cpp        |  6 ++----
 lib/vnode_s3.cpp       |  2 +-
 tools/affconvert.cpp   |  2 +-
 tools/affcopy.cpp      |  8 ++++----
 tools/affinfo.cpp      | 14 --------------
 tools/affix.cpp        |  4 ----
 tools/affrecover.cpp   |  4 ----
 tools/affsign.cpp      |  3 +--
 tools/affstats.cpp     |  8 --------
 16 files changed, 27 insertions(+), 72 deletions(-)

diff --git a/configure.ac b/configure.ac
index 002d972..940353b 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.5],[https://github.com/sshock/AFFLIBv3])
+AC_INIT([AFFLIB],[3.7.6],[https://github.com/sshock/AFFLIBv3])
 AM_INIT_AUTOMAKE
 AM_MAINTAINER_MODE
 
@@ -81,7 +81,7 @@ AC_STRUCT_ST_RDEV
 
 
 # Specific headers that I plan to use
-AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h dmalloc.h err.h errno.h fcntl.h getopt.h inttypes.h linux/fs.h malloc.h ncurses/term.h netinet/in.h regex.h signal.h stdint.h stdio.h stdlib.h string.h sys/cdefs.h sys/disk.h sys/file.h sys/ioctl.h sys/ioctl.h sys/param.h sys/param.h sys/socket.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sysexits.h term.h time.h unistd.h zlib.h _mingw.h])
+AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h dmalloc.h err.h errno.h fcntl.h getopt.h inttypes.h linux/fs.h malloc.h netinet/in.h regex.h signal.h stdint.h stdio.h stdlib.h string.h sys/cdefs.h sys/disk.h sys/file.h sys/ioctl.h sys/ioctl.h sys/param.h sys/param.h sys/socket.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sysexits.h term.h time.h unistd.h zlib.h _mingw.h])
 
 AC_CHECK_LIB([regex],[regcomp])        # see if we need -lregex
 
@@ -115,10 +115,9 @@ AC_LANG_POP([C++])
 AC_CHECK_HEADERS([readline/readline.h])
 AC_CHECK_HEADERS([curses.h termcap.h])
 AC_CHECK_LIB([readline],[readline],, AC_MSG_RESULT([readline not installed]))
-AC_CHECK_LIB([ncurses],[initscr],, AC_MSG_RESULT([ncurses not installed]))
 AC_CHECK_LIB([z],[uncompress],, AC_MSG_ERROR([zlib not installed; cannot continue. Try adding zlib-dev or zlib1g-dev.]))
 AC_CHECK_LIB([rt],[aio_error64])
-AC_SEARCH_LIBS(tgetent, termlib termcap tinfo curses ncurses)
+AC_SEARCH_LIBS(tgetent, termlib termcap curses)
 AC_CHECK_FUNCS(putp tputs tgoto tgetstr tgetnum gotorc beep endwin setupterm printw)
 
 ################################################################
@@ -145,7 +144,7 @@ AC_DEFINE(USE_LZMA, 1, [Enable LZMA compression])
 ## S3 requires curl and expat; otherwise we don't need them
 AC_ARG_ENABLE(s3,
 	AC_HELP_STRING([--enable-s3=yes],
-          [Support for Amazon's S3 service. Requires CURL and Expat.]),
+          [Support for Amazon S3 service. Requires CURL and Expat.]),
           [enable_s3=$enableval], [enable_s3=no])
 
 if test "x${enable_s3}" = "xyes" ; then
@@ -217,18 +216,15 @@ AM_CONDITIONAL(HAVE_PYTHON, test "$enable_python" = yes)
 ################################################################
 ################################################################
 ## Crypto (must follow S3)
-## Note: -lssl is needed on Linux
-##       -lcrypto is needed on MacOS
+## Note: -lcrypto is needed on Linux and MacOS
 ##       -lmd is needed on some older systems
-##       -lssl and -lcrypto are needed if using libressl
+##       TBD: is -lssl needed if using libressl?
 ## Always check for headers, then libs, then functions
 ###
 
 AC_CHECK_HEADERS([openssl/aes.h openssl/bio.h openssl/evp.h openssl/hmac.h openssl/md5.h openssl/rand.h openssl/rsa.h openssl/sha.h openssl/pem.h openssl/x509.h])
 
-AC_CHECK_LIB([crypto],[EVP_get_digestbyname])
-
-AC_CHECK_LIB([ssl],[SSL_library_init],,
+AC_CHECK_LIB([crypto],[EVP_get_digestbyname],,
 	AC_MSG_ERROR([OpenSSL developer library 'libssl-dev' or 'openssl-devel' not installed; cannot continue.]))
 
 AC_CHECK_LIB([md],[MD5])		# if libmd is available, get it
diff --git a/doc/announce_3.7.5.txt b/doc/announce_3.7.5.txt
index d06122c..a38f1bf 100644
--- a/doc/announce_3.7.5.txt
+++ b/doc/announce_3.7.5.txt
@@ -1,7 +1,7 @@
 			ANNOUNCING AFFLIB 3.7.5
 			Oct 11, 2014
 
-AFFLIB is no longer being mainted by Simson Garfinkel.
+AFFLIB is no longer being maintained by Simson Garfinkel.
 - See https://github.com/simsong/AFFLIBv3/issues/16 for details.
 
 My name is Phillip Hellewell.  To keep AFFLIB alive I created a fork
diff --git a/lib/afflib.cpp b/lib/afflib.cpp
index 090ed8b..66d96a8 100644
--- a/lib/afflib.cpp
+++ b/lib/afflib.cpp
@@ -596,16 +596,8 @@ int af_make_badflag(AFFILE *af)
     if(af->badflag!=0) free(af->badflag);
     af->badflag = (unsigned char *)malloc(af->image_sectorsize); // current sector size
 
-#ifdef HAVE_RAND_pseudo_bytes
-    /* Use a good random number generator if we have it */
     RAND_pseudo_bytes(af->badflag,af->image_sectorsize);
     strcpy((char *)af->badflag,"BAD SECTOR");
-#else
-    /* Otherwise use a bad one */
-    for(uint32_t i=0;i<af->image_sectorsize;i++){
-      af->badflag[i] = rand() & 0xff;
-    }
-#endif
 
     AF_WRLOCK(af);
     af->badflag_set = 1;
diff --git a/lib/afflib_i.h b/lib/afflib_i.h
index 131f648..b05374d 100644
--- a/lib/afflib_i.h
+++ b/lib/afflib_i.h
@@ -104,7 +104,7 @@ void __cdecl AFDbgPrint (PCSTR Format,...);
 #include <alloca.h>
 #endif
 
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_LIBCRYPTO
 #include <openssl/aes.h>
 #include <openssl/rsa.h>		// a standard part of OpenSSL
 #include <openssl/rand.h>
diff --git a/lib/aftest.cpp b/lib/aftest.cpp
index efa64f0..a46edea 100644
--- a/lib/aftest.cpp
+++ b/lib/aftest.cpp
@@ -233,13 +233,7 @@ int random_read_test(int total_bytes,int data_page_size)
     unsigned char *buf2 = (unsigned char *)malloc(total_bytes);
 
     /* First half is random */
-#ifdef HAVE_RAND_PSEUDO_BYTES
     RAND_pseudo_bytes(buf,total_bytes/2);
-#else
-    for(int i=0;i<total_bytes/2;i++){
-	buf[i] = random();
-    }
-#endif
 
     /* Second half is a bit more predictable */
     for(int i=total_bytes/2;i<total_bytes;i++){
diff --git a/lib/qemu/block-vvfat.c b/lib/qemu/block-vvfat.c
index c4d5182..ee109b7 100644
--- a/lib/qemu/block-vvfat.c
+++ b/lib/qemu/block-vvfat.c
@@ -512,9 +512,11 @@ static inline uint8_t fat_chksum(const direntry_t* entry)
     uint8_t chksum=0;
     int i;
 
-    for(i=0;i<11;i++)
-	chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0))
-	    +(unsigned char)entry->name[i];
+    for(i=0;i<11;i++) {
+	unsigned char c;
+	c = (i < 8) ? entry->name[i] : entry->extension[i-8];
+	chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0)) + c;
+    }
 
     return chksum;
 }
diff --git a/lib/qemu/qemu-common.h b/lib/qemu/qemu-common.h
index e8ea687..7ea974e 100644
--- a/lib/qemu/qemu-common.h
+++ b/lib/qemu/qemu-common.h
@@ -27,6 +27,10 @@
 #define ENOMEDIUM ENODEV
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #ifdef _WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
diff --git a/lib/s3_glue.cpp b/lib/s3_glue.cpp
index c77b78e..8544cf9 100644
--- a/lib/s3_glue.cpp
+++ b/lib/s3_glue.cpp
@@ -553,7 +553,7 @@ response_buffer *get_url(const char *url)
 	curl_easy_setopt(c,CURLOPT_WRITEFUNCTION,buffer_write);
 	curl_easy_setopt(c,CURLOPT_WRITEDATA,b);
 	curl_easy_setopt(c,CURLOPT_URL,url);
-	int success = curl_easy_perform(c);
+	curl_easy_perform(c);
 	curl_easy_getinfo(c,CURLINFO_RESPONSE_CODE,&b->result);
 	curl_easy_cleanup(c);
     } while(b->result!=200 && ++retry_count<s3_retry_max);
@@ -620,9 +620,7 @@ static const char *hexbuf(char *dst,int dst_len,const unsigned char *bin,int byt
 	bytes--;
 	charcount++;			// how many characters
 
-	bool add_spaces = false;
-	if(flag & HEXBUF_SPACE2) add_spaces = true;
-	if((flag & HEXBUF_SPACE4) && charcount%2==0){
+	if((flag & HEXBUF_SPACE2) || ((flag & HEXBUF_SPACE4) && charcount%2==0)){
 	    *dst++ = ' ';
 	    *dst   = '\000';
 	    dst_len -= 1;
diff --git a/lib/vnode_s3.cpp b/lib/vnode_s3.cpp
index 5e3ddec..f9904b9 100644
--- a/lib/vnode_s3.cpp
+++ b/lib/vnode_s3.cpp
@@ -266,7 +266,7 @@ static int s3_update_seg(AFFILE *af, const char *name,
 {
     struct s3_private *sp =S3_PRIVATE(af);
     char metabuf[64];
-    snprintf(metabuf,sizeof(metabuf),"%lu",arg);	// get the arg
+    snprintf(metabuf,sizeof(metabuf),"%u",arg);	// get the arg
     struct s3headers meta[] = {{S3_HEADER_ARG,metabuf},{0,0}};
 
     sp->current_seg = name;
diff --git a/tools/affconvert.cpp b/tools/affconvert.cpp
index b20c926..4024abe 100644
--- a/tools/affconvert.cpp
+++ b/tools/affconvert.cpp
@@ -690,7 +690,7 @@ int main(int argc,char **argv)
 	 */
 	if(opt_outdir){
 	    cc = strrchr(outfile,'/');
-	    char filename[PATH_MAX];
+	    char filename[MAXPATHLEN];
 	    if(cc){
 		strlcpy(filename,cc+1,sizeof(filename));	// just the filename
 	    }
diff --git a/tools/affcopy.cpp b/tools/affcopy.cpp
index 2503dff..22e9cb1 100644
--- a/tools/affcopy.cpp
+++ b/tools/affcopy.cpp
@@ -43,10 +43,6 @@ using namespace aff;
 #include <term.h>
 #endif
 
-#ifdef HAVE_NCURSES_TERM_H
-#include <ncurses/term.h>
-#endif
-
 #ifdef WIN32
 #include "unix4win32.h"
 #endif
@@ -398,7 +394,9 @@ int affcopy(char *infile,vector<string> &outfiles)
 
 	    u_char seghash[32]; /* resultant message digest; could be any size */
 	    unsigned int seghash_len = sizeof(seghash); /* big enough to hold SHA256 */
+#ifdef USE_AFFSIGS
 	    int sigmode = AF_SIGNATURE_MODE0;
+#endif
 
 	    memset(seghash,0,sizeof(seghash));
 
@@ -409,7 +407,9 @@ int affcopy(char *infile,vector<string> &outfiles)
 		if(copy_page(ain,aout->af,pagenumber,arg,seghash,&seghash_len)==0){
 		    preened_pages.push_back(pagenumber); // preened pages won't be verified by md5
 		    if(opt_debug && opt_preen) printf(" (PREENED) ");
+#ifdef USE_AFFSIGS
 		    sigmode = AF_SIGNATURE_MODE1;
+#endif
 		    copied = true;
 		}
 	    }
diff --git a/tools/affinfo.cpp b/tools/affinfo.cpp
index b48bd59..47cbd22 100644
--- a/tools/affinfo.cpp
+++ b/tools/affinfo.cpp
@@ -41,10 +41,6 @@ using namespace std;
 #include <term.h>
 #endif
 
-#ifdef HAVE_NCURSES_TERM_H
-#include <ncurses/term.h>
-#endif
-
 #ifdef WIN32
 #include "unix4win32.h"
 #endif
@@ -771,16 +767,6 @@ int main(int argc,char **argv)
     int ch;
     const char *infile;
 
-    /* Figure out how many cols the screen has... */
-#ifdef HAVE_LIBNCURSES
-    term = getenv("TERM");
-    if(term){
-	setupterm((char *)0,1,(int *)0);
-	start_color();
-	cols = tgetnum((char *)"co");
-    }
-#endif
-
     while ((ch = getopt(argc, argv, "abh?s:SmiIwj:p:xvVX5dAl")) != -1) {
 	switch (ch) {
 	case 'a': opt_all++; break;
diff --git a/tools/affix.cpp b/tools/affix.cpp
index 6c5368e..92baff4 100644
--- a/tools/affix.cpp
+++ b/tools/affix.cpp
@@ -28,10 +28,6 @@
 #include <term.h>
 #endif
 
-#ifdef HAVE_NCURSES_TERM_H
-#include <ncurses/term.h>
-#endif
-
 #ifdef WIN32
 #include "unix4win32.h"
 #include <malloc.h>
diff --git a/tools/affrecover.cpp b/tools/affrecover.cpp
index 965a55a..8de7ba8 100644
--- a/tools/affrecover.cpp
+++ b/tools/affrecover.cpp
@@ -27,10 +27,6 @@
 #include <term.h>
 #endif
 
-#ifdef HAVE_NCURSES_TERM_H
-#include <ncurses/term.h>
-#endif
-
 #ifdef WIN32
 #include "unix4win32.h"
 #include <malloc.h>
diff --git a/tools/affsign.cpp b/tools/affsign.cpp
index 2c7701a..faabddd 100644
--- a/tools/affsign.cpp
+++ b/tools/affsign.cpp
@@ -256,10 +256,9 @@ int remove_signatures(const char *fn)
 
 int main(int argc,char **argv)
 {
-    int bflag, ch;
+    int ch;
     int opt_zap = 0;
 
-    bflag = 0;
     while ((ch = getopt(argc, argv, "nk:c:h?vZ")) != -1) {
 	switch (ch) {
 	case 'n': opt_note = 1;break;
diff --git a/tools/affstats.cpp b/tools/affstats.cpp
index 78bb67f..3cb7778 100644
--- a/tools/affstats.cpp
+++ b/tools/affstats.cpp
@@ -69,14 +69,6 @@
 #include <term.h>
 #endif
 
-#ifdef HAVE_NCURSES_TERM_H
-#include <ncurses/term.h>
-#endif
-
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
-#endif
-
 #ifdef WIN32
 #include "unix4win32.h"
 #include <malloc.h>

-- 
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