mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
immutable: defensive programming: assert that the encrypted readable gave you no more than the number of bytes you asked for
(There is a bug in the current DownUpConnector which can cause it to give more bytes than you asked for on one request, and then less on the next, effectively shifting some of the bytes to an earlier request, but I think this bug never gets triggered in practice.)
This commit is contained in:
parent
1d13be3701
commit
c59940852b
@ -389,6 +389,9 @@ class Encoder(object):
|
||||
self._crypttext_hasher.update(encrypted_piece)
|
||||
encrypted_pieces.append(encrypted_piece)
|
||||
|
||||
precondition(length <= input_chunk_size,
|
||||
"length=%d > input_chunk_size=%d" %
|
||||
(length, input_chunk_size))
|
||||
if allow_short:
|
||||
if length < input_chunk_size:
|
||||
# padding
|
||||
|
Loading…
Reference in New Issue
Block a user