changeset 188:d588dafd03e8 stable-0-6-36

prep for fedora build
author Carl Byington <carl@five-ten-sg.com>
date Tue, 14 Apr 2009 07:53:13 -0700
parents cf8bbbb746e7
children dc807f71d9d2
files ChangeLog NEWS libpst.spec.in src/dumpblocks.c src/libpst.c src/libpst.h
diffstat 6 files changed, 29 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Apr 13 20:36:20 2009 -0700
+++ b/ChangeLog	Tue Apr 14 07:53:13 2009 -0700
@@ -1,4 +1,4 @@
-LibPST 0.6.36 (2009-04-13)
+LibPST 0.6.36 (2009-04-14)
 ===============================
     * spec file cleanup with multiple sub packages.
     * add doxygen devel-doc documentation for the shared library.
--- a/NEWS	Mon Apr 13 20:36:20 2009 -0700
+++ b/NEWS	Tue Apr 14 07:53:13 2009 -0700
@@ -1,4 +1,4 @@
-0.6.36  2009-04-13 build separate -doc and -devel-doc subpackages
+0.6.36  2009-04-14 build separate -doc and -devel-doc subpackages
 0.6.35  2009-04-08 properly add trailing mime boundary in all modes, build separate rpms with libpst.so shared.
 0.6.34  2009-03-19 avoid putting mixed item types into the same output folder
 0.6.33  2009-03-17 fix utf-7 conversions, don't produce empty attachment files in separate mode
--- a/libpst.spec.in	Mon Apr 13 20:36:20 2009 -0700
+++ b/libpst.spec.in	Tue Apr 14 07:53:13 2009 -0700
@@ -125,7 +125,7 @@
 
 
 %changelog
-* Mon Apr 13 2009 Carl Byington <carl@five-ten-sg.com> - 0.6.36-1
+* Tue Apr 14 2009 Carl Byington <carl@five-ten-sg.com> - 0.6.36-1
 - build separate -doc and -devel-doc subpackages.
 - other spec file cleanup
 
--- a/src/dumpblocks.c	Mon Apr 13 20:36:20 2009 -0700
+++ b/src/dumpblocks.c	Tue Apr 14 07:53:13 2009 -0700
@@ -55,16 +55,9 @@
     outname = (char *) pst_malloc(OUT_BUF);
     printf("Saving blocks\n");
     while (ptr != NULL) {
-        /*    if (pstfile.encryption == PST_ENC) {
-           c = pst_ff_getIDblock_dec(&pstfile, ptr->i_id, buf);
-           } else { */
-        if ((ptr->i_id & 0x02) == 0 && pstfile.encryption == PST_ENC) {
-            c = pst_ff_getIDblock_dec(&pstfile, ptr->i_id, &buf);
-        } else {
-            c = pst_ff_getIDblock(&pstfile, ptr->i_id, &buf);
-        }
-
-        if (c > 0) {
+        size_t c;
+        c = pst_ff_getIDblock_dec(&pstfile, ptr->i_id, &buf);
+        if (c) {
             snprintf(outname, OUT_BUF, "%#"PRIx64, ptr->i_id);
             if ((fp = fopen(outname, "wb")) == NULL) {
                 printf("Failed to open file %s\n", outname);
--- a/src/libpst.c	Mon Apr 13 20:36:20 2009 -0700
+++ b/src/libpst.c	Tue Apr 14 07:53:13 2009 -0700
@@ -172,7 +172,7 @@
 static pst_id2_tree*      pst_build_id2(pst_file *pf, pst_index_ll* list);
 static int              pst_build_id_ptr(pst_file *pf, int64_t offset, int32_t depth, uint64_t linku1, uint64_t start_val, uint64_t end_val);
 static int              pst_chr_count(char *str, char x);
-static size_t           pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size);
+static size_t           pst_ff_compile_ID(pst_file *pf, uint64_t i_id, pst_holder *h, size_t size);
 static size_t           pst_ff_getID2block(pst_file *pf, uint64_t id2, pst_id2_tree *id2_head, char** buf);
 static size_t           pst_ff_getID2data(pst_file *pf, pst_index_ll *ptr, pst_holder *h);
 static void             pst_free_attach(pst_item_attach *attach);
@@ -3599,7 +3599,7 @@
 }
 
 
-int pst_decrypt(uint64_t id, char *buf, size_t size, unsigned char type) {
+int pst_decrypt(uint64_t i_id, char *buf, size_t size, unsigned char type) {
     size_t x = 0;
     unsigned char y;
     DEBUG_ENT("pst_decrypt");
@@ -3619,7 +3619,7 @@
     } else if (type == PST_ENCRYPT) {
         // The following code was based on the information at
         // http://www.passcape.com/outlook_passwords.htm
-        uint16_t salt = (uint16_t) (((id & 0x00000000ffff0000) >> 16) ^ (id & 0x000000000000ffff));
+        uint16_t salt = (uint16_t) (((i_id & 0x00000000ffff0000) >> 16) ^ (i_id & 0x000000000000ffff));
         x = 0;
         while (x < size) {
             uint8_t losalt = (salt & 0x00ff);
@@ -3726,19 +3726,19 @@
  * Get an ID block from file using _pst_ff_getIDblock and decrypt if necessary
  *
  * @param pf   PST file structure
- * @param id   ID of block to retrieve
- * @param buf  Reference to pointer that will be set to new block. Any memory
-               pointed to by buffer will be free()d beforehand
- * @return     Size of block pointed to by *b
+ * @param i_id ID of block to retrieve
+ * @param buf  reference to pointer to buffer that will contain the data block.
+ *             If this pointer is non-NULL, it will first be free()d.
+ * @return     Size of block read into memory
  */
-size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, char **buf) {
+size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t i_id, char **buf) {
     size_t r;
-    int noenc = (int)(id & 2);   // disable encryption
+    int noenc = (int)(i_id & 2);   // disable encryption
     DEBUG_ENT("pst_ff_getIDblock_dec");
-    DEBUG_INDEX(("for id %#"PRIi64"\n", id));
-    r = pst_ff_getIDblock(pf, id, buf);
+    DEBUG_INDEX(("for id %#"PRIi64"\n", i_id));
+    r = pst_ff_getIDblock(pf, i_id, buf);
     if ((pf->encryption) && !(noenc)) {
-        (void)pst_decrypt(id, *buf, r, pf->encryption);
+        (void)pst_decrypt(i_id, *buf, r, pf->encryption);
     }
     DEBUG_HEXDUMPC(*buf, r, 16);
     DEBUG_RET();
@@ -3748,23 +3748,23 @@
 
 /**
  * Read a block of data from file into memory
- * @param pf   PST file
- * @param id   identifier of block to read
- * @param buf  reference to pointer to buffer. If this pointer
-               is non-NULL, it will first be free()d
+ * @param pf   PST file structure
+ * @param i_id ID of block to read
+ * @param buf  reference to pointer to buffer that will contain the data block.
+ *             If this pointer is non-NULL, it will first be free()d.
  * @return     size of block read into memory
  */
-size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, char** buf) {
+size_t pst_ff_getIDblock(pst_file *pf, uint64_t i_id, char** buf) {
     pst_index_ll *rec;
     size_t rsize;
     DEBUG_ENT("pst_ff_getIDblock");
-    rec = pst_getID(pf, id);
+    rec = pst_getID(pf, i_id);
     if (!rec) {
-        DEBUG_INDEX(("Cannot find ID %#"PRIx64"\n", id));
+        DEBUG_INDEX(("Cannot find ID %#"PRIx64"\n", i_id));
         DEBUG_RET();
         return 0;
     }
-    DEBUG_INDEX(("id = %#"PRIx64", record size = %#x, offset = %#x\n", id, rec->size, rec->offset));
+    DEBUG_INDEX(("id = %#"PRIx64", record size = %#x, offset = %#x\n", i_id, rec->size, rec->offset));
     rsize = pst_read_block_size(pf, rec->offset, rec->size, buf);
     DEBUG_RET();
     return rsize;
@@ -3821,7 +3821,7 @@
 }
 
 
-static size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size) {
+static size_t pst_ff_compile_ID(pst_file *pf, uint64_t i_id, pst_holder *h, size_t size) {
     size_t z, a;
     uint16_t count, y;
     char *buf3 = NULL, *buf2 = NULL, *t;
@@ -3833,7 +3833,7 @@
     pst_table3_rec table3_rec;  //for type 3 (0x0101) blocks
 
     DEBUG_ENT("pst_ff_compile_ID");
-    a = pst_ff_getIDblock(pf, id, &buf3);
+    a = pst_ff_getIDblock(pf, i_id, &buf3);
     if (!a) {
         if (buf3) free(buf3);
         DEBUG_RET();
@@ -3848,7 +3848,7 @@
 
     if (block_hdr.index_offset != (uint16_t)0x0101) { //type 3
         DEBUG_WARN(("WARNING: not a type 0x0101 buffer, Treating as normal buffer\n"));
-        if (pf->encryption) (void)pst_decrypt(id, buf3, a, pf->encryption);
+        if (pf->encryption) (void)pst_decrypt(i_id, buf3, a, pf->encryption);
         if (h->buf)
             *(h->buf) = buf3;
         else if (h->base64 == 1 && h->fp) {
--- a/src/libpst.h	Mon Apr 13 20:36:20 2009 -0700
+++ b/src/libpst.h	Tue Apr 14 07:53:13 2009 -0700
@@ -32,10 +32,6 @@
 #define PST_TYPE_OTHER      13
 #define PST_TYPE_REPORT     14
 
-// defines whether decryption is done on this bit of data
-#define PST_NO_ENC 0
-#define PST_ENC    1
-
 // defines types of possible encryption
 #define PST_NO_ENCRYPT   0
 #define PST_COMP_ENCRYPT 1