]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
dump-cap: include UEB_hash in output
authorBrian Warner <warner@allmydata.com>
Wed, 6 Feb 2008 19:48:19 +0000 (12:48 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 6 Feb 2008 19:48:19 +0000 (12:48 -0700)
src/allmydata/scripts/debug.py
src/allmydata/test/test_system.py
src/allmydata/uri.py

index cf08a20642a702b613a50fb79cf7ea15d5a4c1ec..ea2fefbebfb62ef1839db4d216b8a5a0dcfd32fa 100644 (file)
@@ -34,15 +34,15 @@ def dump_share(config, out=sys.stdout, err=sys.stderr):
     seek = offsets['uri_extension']
     length = struct.unpack(">L", f.read_share_data(seek, 4))[0]
     seek += 4
-    data = f.read_share_data(seek, length)
+    UEB_data = f.read_share_data(seek, length)
 
-    unpacked = uri.unpack_extension_readable(data)
+    unpacked = uri.unpack_extension_readable(UEB_data)
     keys1 = ("size", "num_segments", "segment_size",
              "needed_shares", "total_shares")
     keys2 = ("codec_name", "codec_params", "tail_codec_params")
     keys3 = ("plaintext_hash", "plaintext_root_hash",
              "crypttext_hash", "crypttext_root_hash",
-             "share_root_hash")
+             "share_root_hash", "UEB_hash")
     display_keys = {"size": "file_size"}
     for k in keys1:
         if k in unpacked:
@@ -70,7 +70,7 @@ def dump_share(config, out=sys.stdout, err=sys.stderr):
     sizes['data'] = bp._data_size
     sizes['validation'] = (offsets['uri_extension'] -
                            offsets['plaintext_hash_tree'])
-    sizes['uri-extension'] = len(data)
+    sizes['uri-extension'] = len(UEB_data)
     print >>out
     print >>out, "Size of data within the share:"
     for k in sorted(sizes):
index 04b69eab50b8d4bca3d8b5f6045f4b2d8430ca7e..8f669f6cf10a1f442444238a8d7092f27f0e95a7 100644 (file)
@@ -1155,7 +1155,7 @@ class SystemTest(testutil.SignalMixin, testutil.PollMixin, unittest.TestCase):
                     "codec_name", "codec_params", "tail_codec_params",
                     "plaintext_hash", "plaintext_root_hash",
                     "crypttext_hash", "crypttext_root_hash",
-                    "share_root_hash",):
+                    "share_root_hash", "UEB_hash"):
             self.failUnless("%s: " % key in output, key)
 
     def _test_control(self, res):
index 44df1f483a5bf83cbfdebdc6ad651bfb91d0dcb7..a630f188519b47ec8e4d336ab31707c4d7a1f67d 100644 (file)
@@ -508,6 +508,7 @@ def unpack_extension(data):
 
 def unpack_extension_readable(data):
     unpacked = unpack_extension(data)
+    unpacked["UEB_hash"] = hashutil.uri_extension_hash(data)
     for k in sorted(unpacked.keys()):
         if 'hash' in k:
             unpacked[k] = idlib.b2a(unpacked[k])