[Forensics-changes] [afflib] 02/03: Merge branch 'upstream'

Joao Eriberto Mota Filho eriberto at moszumanska.debian.org
Thu Oct 2 14:14:21 UTC 2014


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

eriberto pushed a commit to branch master
in repository afflib.

commit 7ae365340172e0de05c9198596efd05e5947a945
Merge: 535b711 1247d6a
Author: Joao Eriberto Mota Filho <eriberto at debian.org>
Date:   Thu Oct 2 11:01:23 2014 -0300

    Merge branch 'upstream'
    
    Conflicts:
    	ChangeLog
    	INSTALL
    	config.h.in
    	configure.ac
    	lib/aff_db.cpp
    	lib/afflib.cpp
    	lib/afflib.h
    	lib/afflib_i.h
    	lib/afflib_os.cpp
    	lib/afflib_stream.cpp
    	lib/afflib_util.cpp
    	lib/aftimer.h
    	lib/crypto.cpp
    	lib/s3.cpp
    	lib/vnode_afd.cpp
    	lib/vnode_aff.cpp
    	lib/vnode_afm.cpp
    	lib/vnode_raw.cpp
    	lib/vnode_s3.cpp
    	lib/vnode_split_raw.cpp
    	tools/aff_bom.cpp
    	tools/test_fatty.sh
    	tools/test_sealing.sh

 ChangeLog                              |  11 ++
 INSTALL                                |  20 ++-
 Makefile.am                            |  11 +-
 configure.ac                           |  29 ++--
 lib/Makefile.am                        |   4 +-
 lib/aff_db.cpp                         |  16 ++-
 lib/aff_toc.cpp                        |  96 ++++++++++++-
 lib/afflib.cpp                         |  59 ++++----
 lib/afflib.h                           |  49 ++++---
 lib/afflib_i.h                         |  37 +++--
 lib/afflib_os.cpp                      |  16 ++-
 lib/afflib_pages.cpp                   |  87 +++++++----
 lib/afflib_stream.cpp                  | 105 +++++++-------
 lib/afflib_util.cpp                    |   8 +-
 lib/aftest.cpp                         |  52 +++----
 lib/aftimer.h                          |  22 ++-
 lib/base64.cpp                         |  12 +-
 lib/base64.h                           |   0
 lib/crypto.cpp                         |  70 ++++-----
 lib/lzma_glue.cpp                      |   8 +-
 lib/qemu/block-vmdk.c                  |  10 +-
 lib/qemu/block-vvfat.c                 |  12 +-
 lib/s3.cpp                             |  18 ++-
 lib/s3_glue.cpp                        |  28 ++--
 lib/s3_glue.h                          |   4 +-
 lib/utils.cpp                          |   6 +-
 lib/vnode_afd.cpp                      |  52 ++++---
 lib/vnode_aff.cpp                      | 254 +++++++++++++++------------------
 lib/vnode_afm.cpp                      |  22 +--
 lib/vnode_qemu.cpp                     |   6 +-
 lib/vnode_raw.cpp                      |  52 ++++---
 lib/vnode_s3.cpp                       |  20 +--
 lib/vnode_split_raw.cpp                |  39 +++--
 tests/Makefile.am                      |   2 +-
 tests/{encrypted.iso => encrypted.raw} |   0
 tests/test_decryption.sh               |   4 +-
 tools/Makefile.am                      |   2 +-
 tools/aff_bom.cpp                      |   9 ++
 tools/affinfo.cpp                      |  16 ++-
 tools/test_afsegment.sh                |   7 +-
 tools/test_crypto.sh                   |   2 +-
 tools/test_fatty.sh                    |   4 +
 tools/test_passphrase.sh               |   2 +-
 tools/test_recovery.sh                 |   4 +-
 tools/test_sealing.sh                  |   4 +
 tools/test_signing.sh                  |  28 ++--
 46 files changed, 813 insertions(+), 506 deletions(-)

diff --cc ChangeLog
index 4a43c32,469771e..fd9e716
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,3 -1,11 +1,14 @@@
++<<<<<<< HEAD
++=======
+ 2013-11-16  Basic  <simsong at Mucha.local>
+ 
+ 	* configure.ac: version bumped to 3.7.4
+ 
+ 2013-10-29  Man Page  <simsong at mncrnpsedu.local>
+ 
+ 	* configure.ac: updated for OSX Mavericks (10.9)
+ 
++>>>>>>> upstream
  2012-05-21  Simson Garfinkel  <simsong at mncrnpsedu.local>
  
  	* configure.ac: version bumped to 3.7.1
diff --cc INSTALL
index a02d9a0,8e14a0c..09544cd
--- a/INSTALL
+++ b/INSTALL
@@@ -7,6 -11,10 +11,16 @@@ To disable optimization, do this
  
        ./configure 'CXXFLAGS=-O0 -g' 'CFLAGS=-O0 -g'
  
++<<<<<<< HEAD
 +
 +Optimization is automatically disabled if the environment variable
- AFF_NOOPT is set.
++AFF_NOOPT is set.
++=======
+ Optimization is automatically disabled if the environment variable
+ AFF_NOOPT is set.
+ 
+ If you are trying to compile out of a git or SVN repository, then you
+ need to run autoconf to create the configure script and other
+ tempaltes. We have provided a script called "./bootstrap.sh" that will
 -do this for you.
++do this for you.
++>>>>>>> upstream
diff --cc configure.ac
index ca77f85,47a3e4c..aa171fc
--- a/configure.ac
+++ b/configure.ac
@@@ -4,7 -4,7 +4,11 @@@
  # See http://autotoolset.sourceforge.net/tutorial.html
  # and http://www.openismus.com/documents/linux/automake/automake.shtml
  
++<<<<<<< HEAD
 +AC_INIT([AFFLIB],[3.7.1],[bugs at afflib.org])
++=======
+ AC_INIT([AFFLIB],[3.7.4],[bugs at afflib.org])
++>>>>>>> upstream
  AM_INIT_AUTOMAKE
  AM_MAINTAINER_MODE
  
diff --cc lib/aff_db.cpp
index 0279b0e,1bc82d8..1f0e9b0
--- a/lib/aff_db.cpp
+++ b/lib/aff_db.cpp
@@@ -1,4 -1,4 +1,8 @@@
++<<<<<<< HEAD
 +/* Distributed under the 4-part Berkeley License */ 
++=======
+ /* Distributed under the 4-part Berkeley License */
++>>>>>>> upstream
  
  /*
   * afflib_db.cpp:
diff --cc lib/afflib.cpp
index 45eda59,48ada9b..660b2af
--- a/lib/afflib.cpp
+++ b/lib/afflib.cpp
@@@ -655,7 -654,7 +654,11 @@@ void af_aes_decrypt(AFFILE *af,const ch
      /* An encrypted segment was retrieved; decrypt and trunc the length as necessary */
      uint32_t extra = (*datalen) % AES_BLOCK_SIZE;
      uint32_t pad = (AES_BLOCK_SIZE - extra) % AES_BLOCK_SIZE;
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
      if(data==0){			// just wants to find out new length
  	if(extra>0){
  	    *datalen -= AES_BLOCK_SIZE;
@@@ -889,7 -890,7 +894,11 @@@ int af_update_seg(AFFILE *af, const cha
  
  #ifdef HAVE_OPENSSL_BIO_H
  /* Requires no locking */
++<<<<<<< HEAD
 +int	af_update_seg_frombio(AFFILE *af,const char *segname,uint32_t arg,BIO *bio)
++=======
+ int	af_update_seg_frombio(AFFILE *af,const char *segname,uint32_t /*arg*/,BIO *bio)
++>>>>>>> upstream
  {
      /* Get the buffer to write out */
      u_char *buf=0;
diff --cc lib/afflib.h
index ab2d005,d1ff54a..0bbc2c2
--- a/lib/afflib.h
+++ b/lib/afflib.h
@@@ -8,7 -8,7 +8,11 @@@
   * The interface to reading AFF files and  Raw files.
   *
   * Copyright (c) 2005-2006
++<<<<<<< HEAD
 + *	Simson L. Garfinkel and Basis Technology, Inc. 
++=======
+  *	Simson L. Garfinkel and Basis Technology, Inc.
++>>>>>>> upstream
   *      All rights reserved.
   *
   * This code is derrived from software contributed by
@@@ -43,7 -43,7 +47,11 @@@
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++<<<<<<< HEAD
 + * SUCH DAMAGE.  
++=======
+  * SUCH DAMAGE.
++>>>>>>> upstream
   */
  
  /* Figure out what kind of OS we are running on */
@@@ -152,7 -151,7 +159,11 @@@ struct af_vnode_info 
      uint32_t segment_count_signed;
      uint32_t segment_count_encrypted;
      uint32_t page_count_encrypted;
++<<<<<<< HEAD
 +};					// 
++=======
+ };					//
++>>>>>>> upstream
  
  
  /* All of this stuff should be hidden inside a single private structure... */
diff --cc lib/afflib_i.h
index 6208116,6fa02b6..a910d53
--- a/lib/afflib_i.h
+++ b/lib/afflib_i.h
@@@ -6,7 -6,7 +6,11 @@@
   *
   *
   * Copyright (c) 2005-2006
++<<<<<<< HEAD
 + *	Simson L. Garfinkel and Basis Technology, Inc. 
++=======
+  *	Simson L. Garfinkel and Basis Technology, Inc.
++>>>>>>> upstream
   *      All rights reserved.
   *
   * This code is derrived from software contributed by
@@@ -532,7 -532,7 +536,11 @@@ void af_initialize();			// initialize t
  
  /* Internal identification routines */
  int af_identify_file_type(const char *filename,int exists); // returns type of a file; if exists=1, file must exist
++<<<<<<< HEAD
 +const char *af_identify_file_name(const char *filename,int exists); // returns name of a file type; 
++=======
+ const char *af_identify_file_name(const char *filename,int exists); // returns name of a file type;
++>>>>>>> upstream
  int split_raw_increment_fname (char *fn); /* exposed for testing in aftest */
  
  /* AFF implementation types returned by af_identify_type() and af_identify_name()*/
diff --cc lib/afflib_os.cpp
index ecd2ab9,918cb64..9b07cc8
--- a/lib/afflib_os.cpp
+++ b/lib/afflib_os.cpp
@@@ -2,7 -2,7 +2,11 @@@
   * afflib_os.cpp:
   *
   * The OS-specific features of AFFLIB
++<<<<<<< HEAD
 + * 
++=======
+  *
++>>>>>>> upstream
   * This file is a work of a US government employee and as such is in the Public domain.
   * Simson L. Garfinkel, March 12, 2012
   */
diff --cc lib/afflib_stream.cpp
index e1e12d8,9db1604..1b95f3e
--- a/lib/afflib_stream.cpp
+++ b/lib/afflib_stream.cpp
@@@ -16,7 -16,7 +16,11 @@@
  #ifdef _WIN32
  #define ASIZE SSIZE_T
  #else
++<<<<<<< HEAD
 +#define ASIZE ssize_t 
++=======
+ #define ASIZE ssize_t
++>>>>>>> upstream
  #endif
  
  
diff --cc lib/afflib_util.cpp
index 9e32405,74687d9..d05899c
--- a/lib/afflib_util.cpp
+++ b/lib/afflib_util.cpp
@@@ -91,7 -91,7 +91,11 @@@ const char *af_hexbuf(char *dst,int dst
  	dst_len -= 2;
  	bytes--;
  	charcount++;			// how many characters
++<<<<<<< HEAD
 +	
++=======
+ 
++>>>>>>> upstream
  	if((flag & AF_HEXBUF_SPACE4) && charcount%2==0){
  	    *dst++ = ' ';
  	    *dst   = '\000';
diff --cc lib/aftimer.h
index 96b5af1,463def9..d1e3394
--- a/lib/aftimer.h
+++ b/lib/aftimer.h
@@@ -41,13 -41,13 +41,21 @@@ public
      std::string eta_time(double fraction_done); // the actual time
  };
  
++<<<<<<< HEAD
 +/* This code in part from 
++=======
+ /* This code in part from
++>>>>>>> upstream
   * http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/430449b3-f6dd-4e18-84de-eebd26a8d668
   */
  
  #ifdef WIN32
  #  include <winsock2.h>
++<<<<<<< HEAD
 +#  include <windows.h>			
++=======
+ #  include <windows.h>
++>>>>>>> upstream
  #  ifndef DELTA_EPOCH_IN_MICROSECS
  #    if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
  #      define DELTA_EPOCH_IN_MICROSECS  11644473600000000Ui64
@@@ -66,9 -66,9 +74,15 @@@ inline void timestamp(struct timeval *t
      tmpres |= ft.dwHighDateTime;
      tmpres <<= 32;
      tmpres |= ft.dwLowDateTime;
++<<<<<<< HEAD
 + 
 +    /*converting file time to unix epoch*/
 +    tmpres -= DELTA_EPOCH_IN_MICROSECS; 
++=======
+ 
+     /*converting file time to unix epoch*/
+     tmpres -= DELTA_EPOCH_IN_MICROSECS;
++>>>>>>> upstream
      tmpres /= 10;  /*convert into microseconds*/
      t->tv_sec = (long)(tmpres / 1000000UL);
      t->tv_usec = (long)(tmpres % 1000000UL);
@@@ -173,7 -173,7 +187,11 @@@ inline std::string aftimer::eta_time(do
  #else
      tm = *localtime(&when);
  #endif
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
      char buf[64];
      snprintf(buf,sizeof(buf),"%02d:%02d:%02d",tm.tm_hour,tm.tm_min,tm.tm_sec);
      return std::string(buf);
diff --cc lib/crypto.cpp
index 75c0f6b,446edf5..de79d5e
--- a/lib/crypto.cpp
+++ b/lib/crypto.cpp
@@@ -187,7 -187,7 +187,11 @@@ int af_save_aes_key_with_passphrase(AFF
  /** MacOS 10.5 with GCC 4.0.1 packed affkey at 52 bytes.
   ** Linux GCC 4.1.2 packed affkey at 56 bytes. It should be 52 bytes
   ** --- 4 bytes for the version number, 32 bytes for the affkey, 16 bytes for encryption of zeros.
++<<<<<<< HEAD
 + ** original code specified the version as uint32_t version:32, for which the 
++=======
+  ** original code specified the version as uint32_t version:32, for which the
++>>>>>>> upstream
   ** compiler allocated 64 bits...
   ** So this code needs to be willing to accept a 52-byte or 56-byte affkey.
   **/
diff --cc lib/s3.cpp
index 0e42834,e9e03c2..da38e7c
--- a/lib/s3.cpp
+++ b/lib/s3.cpp
@@@ -5,7 -5,7 +5,11 @@@
   * These features would be nice:
   * have "ls" use Delimiter option to just list the drives
   * Give "ls" an option to list just the AFF files.
++<<<<<<< HEAD
 + * Have implementation read a list of all the segments on open, and cache this. 
++=======
+  * Have implementation read a list of all the segments on open, and cache this.
++>>>>>>> upstream
   *
   * Distributed under the Berkeley 4-part license.
   * Simson L. Garfinkel, March 12, 2012
diff --cc lib/vnode_afd.cpp
index 70decd2,e5afbac..10e5212
--- a/lib/vnode_afd.cpp
+++ b/lib/vnode_afd.cpp
@@@ -320,7 -319,7 +319,11 @@@ static int afd_add_file(AFFILE *af,cons
  		unsigned char data[65536];	// big enough for most metadata
  		size_t datalen = sizeof(data);
  		uint32_t arg=0;
++<<<<<<< HEAD
 +		
++=======
+ 
++>>>>>>> upstream
  		if(af_get_seg(af0,*segname,&arg,data,&datalen)==0){
  		    int r = af_update_seg(af2,*segname,arg,data,datalen);
  		    if(r!=0){
@@@ -498,7 -498,7 +502,11 @@@ static int afd_rewind_seg(AFFILE *af
   */
  static int afd_update_seg(AFFILE *af, const char *name,
  		    uint32_t arg,const u_char *value,uint32_t vallen)
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
  {
      struct afd_private *ap = AFD_PRIVATE(af);
      AFFILE *af2 = afd_file_with_seg(af,name);
diff --cc lib/vnode_aff.cpp
index 9d51ce7,1fac55e..2c1a936
--- a/lib/vnode_aff.cpp
+++ b/lib/vnode_aff.cpp
@@@ -22,11 -22,11 +22,19 @@@
  
  static int      aff_write_ignore(AFFILE *af,size_t bytes);
  static int	aff_write_seg(AFFILE *af,const char *name,uint32_t arg,
++<<<<<<< HEAD
 +			      const u_char *value,size_t vallen); 
 +static int	aff_get_seg(AFFILE *af,const char *name,uint32_t *arg,
 +			    unsigned char *data,size_t *datalen);
 +#ifdef KERNEL_LIBRARY
 +static int	aff_write_seg_no_data(AFFILE *af,const char *name,uint32_t arg, size_t vallen); 
++=======
+ 			      const u_char *value,size_t vallen);
+ static int	aff_get_seg(AFFILE *af,const char *name,uint32_t *arg,
+ 			    unsigned char *data,size_t *datalen);
+ #ifdef KERNEL_LIBRARY
+ static int	aff_write_seg_no_data(AFFILE *af,const char *name,uint32_t arg, size_t vallen);
++>>>>>>> upstream
  #endif
  static int	aff_get_next_seg(AFFILE *af,char *segname,size_t segname_len,
  				 uint32_t *arg, unsigned char *data, size_t *datalen);
@@@ -140,7 -140,7 +148,11 @@@ int aff_write_seg(AFFILE *af, const cha
      segt.segment_len = htonl(sizeof(segh)+segname_len + datalen + sizeof(segt));
      aff_toc_update(af,segname,ftello(af->aseg),datalen);
  
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
      if(af_trace) fprintf(af_trace,"aff_write_seg: putting segment %s (datalen=%d) offset=%"PRId64"\n",
  			 segname,(int)datalen,ftello(af->aseg));
  
@@@ -356,102 -360,56 +372,61 @@@ int af_truncate_blank(AFFILE *af
  static int aff_update_seg(AFFILE *af, const char *name,
  		    uint32_t arg,const u_char *value,uint32_t vallen)
  {
-     char   next_segment_name[AF_MAX_NAME_LEN];
-     size_t next_segsize = 0;
-     size_t next_datasize = 0;
- 
-     /* if we are updating with a different size,
-      * remember the location and size of the AF_IGNORE segment that
-      * has the smallest size that is >= strlen(name)+vallen
-      */
      size_t size_needed = vallen+aff_segment_overhead(name);
-     size_t size_closest = 0;
-     uint64_t         loc_closest = 0;
      struct aff_toc_mem *adm = aff_toc(af,name);
++<<<<<<< HEAD
 +       
 +    if(af_trace) fprintf(af_trace,"aff_update_seg(name=%s,arg=%"PRIu32",vallen=%u)\n",name,arg,vallen);
++=======
++>>>>>>> upstream
  
+     if(af_trace) fprintf(af_trace,"aff_update_seg(name=%s,arg=%"PRIu32",vallen=%u)\n",name,arg,vallen);
  
-     if(adm){
- 	/* Segment is in the TOC; seek to it */
- 	fseeko(af->aseg,adm->offset,SEEK_SET);
-     }
-     else {
- 	/* Otherwise, go to the beginning of the file and try to find a suitable hole
- 	 * TK: This could be made significantly faster by just scanning the TOC for a hole.
- 	 */
- 	af_rewind_seg(af);			// start at the beginning
-     }
+     if(adm)
+     {
+ 	/* segment already exists */
+ 	if(fseeko(af->aseg, adm->offset, SEEK_SET) < 0)
+ 	    return -1;
  
-     while(af_probe_next_seg(af,next_segment_name,sizeof(next_segment_name),0,&next_datasize,&next_segsize,1)==0){
- 	/* Remember this information */
- 	uint64_t next_segment_loc = ftello(af->aseg);
- #ifdef DEBUG2
- 	fprintf(stderr,"  next_segment_name=%s next_datasize=%d next_segsize=%d next_segment_loc=%qd\n",
- 		next_segment_name, next_datasize, next_segsize,next_segment_loc);
- #endif
- 	if(strcmp(next_segment_name,name)==0){	// found the segment
- 	    if(next_datasize == vallen){        // Does it exactly fit?
- 		int r = aff_write_seg(af,name,arg,value,vallen); // Yes, just write in place!
- 		return r;
- 	    }
+ 	/* if its size matches, just overwrite it */
+ 	if(adm->segment_len == size_needed)
+ 	    return aff_write_seg(af, name, arg, value, vallen);
  
- 	    //printf("** Segment '%s' doesn't fit at %qd; invalidating.\n",name,ftello(af->aseg));
- 	    aff_write_ignore(af,next_datasize+strlen(name));
+ 	/* otherwise, invalidate it */
+ 	if(aff_write_ignore(af, adm->segment_len - aff_segment_overhead(0)) < 0)
+ 	    return -1;
  
- 	    /* If we are in random mode, jump back to the beginning of the file.
- 	     * This does a good job filling in the holes.
- 	     */
- 	    if(af->random_access){
- 		af_rewind_seg(af);
- 		continue;
- 	    }
+ 	aff_toc_del(af, name);
+     }
  
- 	    /* Otherwise just go to the end. Experience has shown that sequential access
- 	     * tends not to generate holes.
- 	     */
- 	    fseeko(af->aseg,(uint64_t)0,SEEK_END);              // go to the end of the file
- 	    break;			// and exit this loop
- 	    
- 	}
+     /* search through TOC for a hole */
+     /* need space for a new AF_IGNORE segment also */
+     uint64_t hole_offset, hole_size;
+     if(aff_toc_find_hole(af, size_needed + aff_segment_overhead(0), &hole_offset, &hole_size) == 0)
+     {
+ 	/* found a large enough hole */
+ 	if(fseeko(af->aseg, hole_offset, SEEK_SET) < 0)
+ 	    return -1;
+ 
+ 	/* write segment */
+ 	if(aff_write_seg(af, name, arg, value, vallen) < 0)
+ 	    return -1;
+ 
+ 	/* fill in any remaining space with AF_IGNORE */
+ 	return aff_write_ignore(af, hole_size - size_needed - aff_segment_overhead(0));
+     }
  
- 	if((next_segment_name[0]==0) && (next_datasize>=size_needed)){
- 	    //printf("   >> %d byte blank\n",next_datasize);
- 	}
+     /* no holes; seek to end of file and truncate any trailing AF_IGNORE */
+     if(fseeko(af->aseg, 0, SEEK_END) < 0)
+ 	return -1;
  
- 	/* If this is an AF_IGNORE, see if it is a close match */
- 	if((next_segment_name[0]==AF_IGNORE[0]) &&
- 	   (next_datasize>=size_needed) &&
- 	   ((next_datasize<size_closest || size_closest==0)) &&
- 	   ((next_datasize<1024 && size_needed<1024) || (next_datasize>=1024 && size_needed>=1024))){
- 	    size_closest = next_datasize;
- 	    loc_closest  = next_segment_loc;
- 	}
- 	fseeko(af->aseg,next_segsize,SEEK_CUR); // skip this segment
-     }
+     while(af_truncate_blank(af) == 0) {}
  
-     /* Ready to write */
-     if(size_closest>0){
- 	/* Yes. Put it here and put a new AF_IGNORE in the space left-over
- 	 * TODO: If the following space is also an AF_IGNORE, then combine the two.
- 	 */
- 	//printf("*** Squeezing it in at %qd. name=%s. vallen=%d size_closest=%d\n",loc_closest,name,vallen,size_closest);
+     /* write segment at end of file */
+     if(fseeko(af->aseg, 0, SEEK_END) < 0)
+ 	return -1;
  
- 	fseeko(af->aseg,loc_closest,SEEK_SET); // move to the location
- 	aff_write_seg(af,name,arg,value,vallen); // write the new segment
- 	
- 	size_t newsize = size_closest - vallen - aff_segment_overhead(0) - strlen(name);
- 	aff_write_ignore(af,newsize); // write the smaller ignore
- 	return 0;
-     }
-     /* If we reach here we are positioned at the end of the file. */
-     /* If the last segment is an ignore, truncate the file before writing */
-     while(af_truncate_blank(af)==0){
- 	/* Keep truncating until there is nothing left */
-     }
-     //printf("*** appending '%s' bytes=%d to the end\n",name,vallen);
-     fseeko(af->aseg,0L,SEEK_END);		// move back to the end of the file 
-     return aff_write_seg(af,name,arg,value,vallen); // just write at the end
+     return aff_write_seg(af, name, arg, value, vallen);
  }
  
  
diff --cc lib/vnode_afm.cpp
index b65c051,a037a50..d5f24ef
--- a/lib/vnode_afm.cpp
+++ b/lib/vnode_afm.cpp
@@@ -317,7 -317,7 +317,11 @@@ static int afm_rewind_seg(AFFILE *af
   */
  static int afm_update_seg(AFFILE *af, const char *name,
  			  uint32_t arg,const u_char *value,uint32_t vallen)
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
  {
      struct afm_private *ap = AFM_PRIVATE(af);
      int64_t page_num = af_segname_page_number(name); // <0 means update metadata
diff --cc lib/vnode_raw.cpp
index fab306e,83c91b5..794138c
--- a/lib/vnode_raw.cpp
+++ b/lib/vnode_raw.cpp
@@@ -202,7 -206,7 +206,11 @@@ static int raw_get_seg(AFFILE *af,cons
  
  
  int raw_update_seg(AFFILE *af, const char *name,
++<<<<<<< HEAD
 +		    uint32_t arg,const u_char *value,uint32_t vallen)
++=======
+                    uint32_t /*arg*/,const u_char *value,uint32_t vallen)
++>>>>>>> upstream
  {
      struct raw_private *rp = RAW_PRIVATE(af);
  
diff --cc lib/vnode_s3.cpp
index b7bf23c,5e3ddec..1be5a3b
--- a/lib/vnode_s3.cpp
+++ b/lib/vnode_s3.cpp
@@@ -262,7 -262,7 +262,11 @@@ static int s3_rewind_seg(AFFILE *af
   */
  static int s3_update_seg(AFFILE *af, const char *name,
  		    uint32_t arg,const u_char *value,uint32_t vallen)
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
  {
      struct s3_private *sp =S3_PRIVATE(af);
      char metabuf[64];
diff --cc lib/vnode_split_raw.cpp
index 05d8d16,46c37ae..17de27c
--- a/lib/vnode_split_raw.cpp
+++ b/lib/vnode_split_raw.cpp
@@@ -132,12 -132,12 +132,20 @@@ int split_raw_increment_fname (char *fn
  
      /* Get the case */
      int lower = islower(ext[0]);
++<<<<<<< HEAD
 +	
++=======
+ 
++>>>>>>> upstream
      /* Convert to all uppercase */
      for(int i=0;i<3;i++){
  	if(isalpha(ext[i])) ext[i] = toupper(ext[i]);
      }
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
      /* Increment */
      if(incval(ext[2],10)){
  	if(incval(ext[1],36)){
@@@ -536,7 -536,7 +544,11 @@@ static int split_raw_get_seg(AFFILE *af
  
      uint32_t bytes_to_read = af->image_pagesize; // copy this many bytes, unless
      if(bytes_to_read > bytes_left) bytes_to_read = (uint32_t)bytes_left; // only this much is left
++<<<<<<< HEAD
 +    
++=======
+ 
++>>>>>>> upstream
      if(arg) *arg = 0;			// arg is always 0
      if(datalen){
  	if(data==0){ // asked for 0 bytes, so give the actual size
@@@ -603,8 -603,8 +615,13 @@@ static int split_raw_rewind_seg(AFFILE 
  }
  
  static int split_raw_update_seg(AFFILE *af, const char *name,
++<<<<<<< HEAD
 +				uint32_t arg,const u_char *value,uint32_t vallen)
 +    
++=======
+                                 uint32_t /*arg*/,const u_char *value,uint32_t vallen)
+ 
++>>>>>>> upstream
  {
      int64_t page_num = af_segname_page_number(name);
      if(page_num<0){
diff --cc tools/aff_bom.cpp
index 3e1bd9d,a7974b7..102bf55
--- a/tools/aff_bom.cpp
+++ b/tools/aff_bom.cpp
@@@ -212,14 -212,15 +212,23 @@@ int  aff_bom::write(AFFILE *af,aff::seg
  }
  
  
++<<<<<<< HEAD
 +void aff_bom::make_hash(u_char seghash[32], uint32_t arg,const char *segname,
++=======
+ #define SHA256_SIZE 32
+ void aff_bom::make_hash(u_char seghash[SHA256_SIZE], uint32_t arg,const char *segname,
++>>>>>>> upstream
  			const u_char *segbuf, uint32_t segsize)
  {
      OpenSSL_add_all_digests();		// probably a good idea
      const EVP_MD *sha256 = EVP_get_digestbyname("SHA256");
  
      if(sha256){
++<<<<<<< HEAD
 +	unsigned int seghash_len = sizeof(seghash);
++=======
+ 	unsigned int seghash_len = SHA256_SIZE;
++>>>>>>> upstream
  	uint32_t arg_net = htonl(arg);
  	EVP_MD_CTX md;		/* EVP message digest */
  	EVP_DigestInit(&md,sha256);
diff --cc tools/test_fatty.sh
index 7a6ce06,90d572b..c18e7c2
--- a/tools/test_fatty.sh
+++ b/tools/test_fatty.sh
@@@ -1,3 -1,3 +1,7 @@@
  # This file is a work of a US government employee and as such is in the Public domain.
  # Simson L. Garfinkel, March 12, 2012
++<<<<<<< HEAD
 +./affconvert -o file://:password@/fatty.afd fatty.iso
++=======
+ ./affconvert -o file://:password@/fatty.afd fatty.raw
++>>>>>>> upstream
diff --cc tools/test_sealing.sh
index d2a38b7,77d1257..154d92c
--- a/tools/test_sealing.sh
+++ b/tools/test_sealing.sh
@@@ -8,7 -8,7 +8,11 @@@
  BASE=`mktemp -t testfileXXXX`
  SEALING_KEY=$BASE.sealing.key
  SEALING_PEM=$BASE.sealing.pem
++<<<<<<< HEAD
 +EVIDENCE_ISO=$BASE.evidence.iso
++=======
+ EVIDENCE_ISO=$BASE.evidence.raw
++>>>>>>> upstream
  EVIDENCE_AFF=$BASE.evidence.aff
  
  /bin/rm -f $SEALING_KEY $SEALING_PEM $EVIDENCE_ISO $EVIDENCE_AFF

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