All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch 1/1] Chunk: fix stored checksums
@ 2009-12-21  2:45 Pete Zaitcev
  2009-12-21  5:57 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Pete Zaitcev @ 2009-12-21  2:45 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Project Hail List

Existing code writes checksums of something other than the object data.
Fix by summing the object data.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>

---
 server/object.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This seems too obvious... Where is the trap?

diff -urpN -X dontdiff chunkd-m/server/object.c chunkd-tip/server/object.c
--- chunkd-m/server/object.c	2009-12-20 19:06:24.156353635 -0700
+++ chunkd-tip/server/object.c	2009-12-20 19:05:57.130476765 -0700
@@ -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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch 1/1] Chunk: fix stored checksums
  2009-12-21  2:45 [Patch 1/1] Chunk: fix stored checksums Pete Zaitcev
@ 2009-12-21  5:57 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2009-12-21  5:57 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: Project Hail List

On 12/20/2009 09:45 PM, Pete Zaitcev wrote:
> Existing code writes checksums of something other than the object data.
> Fix by summing the object data.
>
> Signed-off-by: Pete Zaitcev<zaitcev@redhat.com>
>
> ---
>   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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-21  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-21  2:45 [Patch 1/1] Chunk: fix stored checksums Pete Zaitcev
2009-12-21  5:57 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.