When decrypting a log item also clear out the IV field.
[bluesky.git] / bluesky / imap.c
index 24144b4..9036263 100644 (file)
@@ -110,7 +110,8 @@ InodeMapEntry *bluesky_inode_map_lookup(GSequence *inode_map, uint64_t inum,
         entry->inum = inum;
         g_sequence_insert_sorted(range->map_entries, entry, compare, NULL);
 
-        g_print("Created inode map entry for %"PRIu64"\n", inum);
+        if (bluesky_verbose)
+            g_print("Created inode map entry for %"PRIu64"\n", inum);
     }
 
     if (action != 0) {
@@ -278,6 +279,9 @@ gboolean bluesky_checkpoint_load(BlueSkyFS *fs)
         return FALSE;
     }
 
+    last = bluesky_string_dup(last);
+    bluesky_cloudlog_decrypt(last->data, last->len, fs->keys);
+
     /* Scan through the contents of the last log segment to find a checkpoint
      * record.  We need to do a linear scan since at this point we don't have a
      * direct pointer; once we have the last commit record then all other data