Chunk: fix stored checksums
PATCH 1/1 Chunk: fix stored checksums
Existing code writes checksums of something other than the object data. Fix by summing the object data.
Signed-off-by Pete Zaitcev <[email protected]>
--- server/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This seems too obvious... Where is the trap?
server/object.c +1 -1
@@ -195,7 +195,7 @@ bool cli_evt_data_in(struct client *cli,return cli_err (cli, che_InternalError, false); } -SHA1_Update (&cli->out_hash, cli->req_ptr, bytes); +SHA1_Update (&cli->out_hash, p, bytes); cli->out_len -= bytes; p += bytes;
Jeff Garzik
AppliedQuoted 10 lines · Pete Zaitcev
Existing code writes checksums of something other than the object data. Fix by summing the object data.
Signed-off-by Pete Zaitcev<[email protected]>--- server/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)This seems too obvious... Where is the trap?
applied... how embarrassing.
The C client definitely needs code to verify each checksum, too. The protocol is designed such that each side can verify checksums at each point in the process... but the implementations are clearly not at the design goal.
Jeff