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.
This commit is contained in:
Brian Warner 2009-06-01 15:49:16 -07:00
parent c516361fd2
commit 4177a3616b
3 changed files with 2 additions and 20 deletions

View File

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

View File

@ -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()

View File

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