Verified Commit 123f9ead authored by Victor's avatar Victor
Browse files

[style] fix typos and add comments from review

parent 2fbf7428
Pipeline #7695 passed with stage
in 83 minutes and 34 seconds
...@@ -105,9 +105,11 @@ class DecrypterBuffer(object): ...@@ -105,9 +105,11 @@ class DecrypterBuffer(object):
real_size = self.decrypter.decrypted_content_size real_size = self.decrypter.decrypted_content_size
return self.decrypter.endStream(), real_size return self.decrypter.endStream(), real_size
elif hasattr(self, 'raw_data'): elif hasattr(self, 'raw_data'):
# Externally encrypted blob, see Incoming API specification # blob was not symmetrically encrypted, see _make_decryptor() above
return self.raw_data, self.raw_data.tell() return self.raw_data, self.raw_data.tell()
else: else:
# the only case that can lead here is if the preamble was not
# completelly consumed by the pipe.
msg = "Incomplete Blob: %s" % self.doc_info.doc_id msg = "Incomplete Blob: %s" % self.doc_info.doc_id
raise RetriableTransferError(msg) raise RetriableTransferError(msg)
......
...@@ -88,7 +88,7 @@ class DecrypterBufferCase(unittest.TestCase): ...@@ -88,7 +88,7 @@ class DecrypterBufferCase(unittest.TestCase):
@defer.inlineCallbacks @defer.inlineCallbacks
def test_incomplete_blob_decryption(self): def test_incomplete_blob_decryption(self):
# SCENARIO: Transport failed and close was called with incomplete data # SCENARIO: Transport failed and close was called with incomplete data
# CASE 1: Incomplete blob of known encryption type # CASE 2: Incomplete blob of known encryption type
# OUTCOME: InvalidBlob. It's safer to assume the tag is invalid # OUTCOME: InvalidBlob. It's safer to assume the tag is invalid
encrypted = (yield self.blob.encrypt()).getvalue() encrypted = (yield self.blob.encrypt()).getvalue()
encrypted = encrypted[:-20] # 20 bytes missing encrypted = encrypted[:-20] # 20 bytes missing
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment