From: Brian Warner <warner@lothar.com>
Date: Mon, 1 Jun 2009 22:49:16 +0000 (-0700)
Subject: remove plaintext-hashing code from the helper interface, to close #722
X-Git-Tag: trac-3900~6
X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/flags/architecture.txt?a=commitdiff_plain;h=4177a3616b6f887c7e18d66b5ed8c392f7b8c28c;p=tahoe-lafs%2Ftahoe-lafs.git

remove plaintext-hashing code from the helper interface, to close #722
and deny the Helper the ability to mount a partial-information-guessing
attack. This will probably break compatibility between new clients and very
old (pre-1.0) helpers.
---

diff --git a/src/allmydata/immutable/offloaded.py b/src/allmydata/immutable/offloaded.py
index 766f0bbd..01dc1ed4 100644
--- a/src/allmydata/immutable/offloaded.py
+++ b/src/allmydata/immutable/offloaded.py
@@ -469,11 +469,7 @@ class LocalCiphertextReader(AskUntilSuccessMixin):
         d = defer.maybeDeferred(self.f.read, length)
         d.addCallback(lambda data: [data])
         return d
-    def get_plaintext_hashtree_leaves(self, first, last, num_segments):
-        return self.call("get_plaintext_hashtree_leaves", first, last,
-                         num_segments)
-    def get_plaintext_hash(self):
-        return self.call("get_plaintext_hash")
+
     def close(self):
         self.f.close()
         # ??. I'm not sure if it makes sense to forward the close message.
diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py
index 26ff331f..4bf07fed 100644
--- a/src/allmydata/immutable/upload.py
+++ b/src/allmydata/immutable/upload.py
@@ -577,6 +577,7 @@ class EncryptAnUploadable:
 
 
     def get_plaintext_hashtree_leaves(self, first, last, num_segments):
+        # this is currently unused, but will live again when we fix #453
         if len(self._plaintext_segment_hashes) < num_segments:
             # close out the last one
             assert len(self._plaintext_segment_hashes) == num_segments-1
@@ -907,15 +908,6 @@ class RemoteEncryptedUploadable(Referenceable):
         d.addCallback(_read)
         return d
 
-    def remote_get_plaintext_hashtree_leaves(self, first, last, num_segments):
-        log.msg("remote_get_plaintext_hashtree_leaves: %d-%d of %d" %
-                (first, last-1, num_segments),
-                level=log.NOISY)
-        d = self._eu.get_plaintext_hashtree_leaves(first, last, num_segments)
-        d.addCallback(list)
-        return d
-    def remote_get_plaintext_hash(self):
-        return self._eu.get_plaintext_hash()
     def remote_close(self):
         return self._eu.close()
 
diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py
index a123afed..13b96e7e 100644
--- a/src/allmydata/interfaces.py
+++ b/src/allmydata/interfaces.py
@@ -2122,12 +2122,6 @@ class RIEncryptedUploadable(RemoteInterface):
     def read_encrypted(offset=Offset, length=ReadSize):
         return ListOf(str)
 
-    def get_plaintext_hashtree_leaves(first=int, last=int, num_segments=int):
-        return ListOf(Hash)
-
-    def get_plaintext_hash():
-        return Hash
-
     def close():
         return None