diff --git a/Makefile b/Makefile
index e74b90b..e55d352 100644
--- a/Makefile
+++ b/Makefile
@@ -45,9 +45,9 @@
 
 LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
 	 tag.o delta.o date.o index.o diff-delta.o patch-delta.o entry.o \
-	 epoch.o refs.o
+	 epoch.o refs.o csum-file.o
 LIB_FILE=libgit.a
-LIB_H=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h
+LIB_H=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h csum-file.h
 
 LIB_H += strbuf.h
 LIB_OBJS += strbuf.o
diff --git a/csum-file.c b/csum-file.c
new file mode 100644
index 0000000..98cb59d
--- /dev/null
+++ b/csum-file.c
@@ -0,0 +1,120 @@
+/*
+ * csum-file.c
+ *
+ * Copyright (C) 2005 Linus Torvalds
+ *
+ * Simple file write infrastructure for writing SHA1-summed
+ * files. Useful when you write a file that you want to be
+ * able to verify hasn't been messed with afterwards.
+ */
+#include "cache.h"
+#include "csum-file.h"
+
+static int sha1flush(struct sha1file *f, unsigned int count)
+{
+	void *buf = f->buffer;
+
+	for (;;) {
+		int ret = write(f->fd, buf, count);
+		if (ret > 0) {
+			buf += ret;
+			count -= ret;
+			if (count)
+				continue;
+			return 0;
+		}
+		if (!ret)
+			die("sha1 file write error. Out of diskspace");
+		if (errno == EAGAIN || errno == EINTR)
+			continue;
+		die("sha1 file write error (%s)", strerror(errno));
+	}
+}
+
+int sha1close(struct sha1file *f)
+{
+	unsigned offset = f->offset;
+	if (offset) {
+		SHA1_Update(&f->ctx, f->buffer, offset);
+		sha1flush(f, offset);
+	}
+	SHA1_Final(f->buffer, &f->ctx);
+	sha1flush(f, 20);
+	return 0;
+}
+
+int sha1write(struct sha1file *f, void *buf, unsigned int count)
+{
+	while (count) {
+		unsigned offset = f->offset;
+		unsigned left = sizeof(f->buffer) - offset;
+		unsigned nr = count > left ? left : count;
+
+		memcpy(f->buffer + offset, buf, nr);
+		count -= nr;
+		offset += nr;
+		left -= nr;
+		if (!left) {
+			SHA1_Update(&f->ctx, f->buffer, offset);
+			sha1flush(f, offset);
+			offset = 0;
+		}
+		f->offset = offset;
+	}
+	return 0;
+}
+
+struct sha1file *sha1create(const char *fmt, ...)
+{
+	static char filename[PATH_MAX];
+	struct sha1file *f;
+	unsigned len;
+	va_list arg;
+	int fd;
+
+	va_start(arg, fmt);
+	len = vsnprintf(filename, PATH_MAX, fmt, arg);
+	va_end(arg);
+
+	if (len >= PATH_MAX)
+		die("you wascally wabbit, you");
+	fd = open(filename, O_CREAT | O_EXCL | O_WRONLY, 0644);
+	if (fd < 0)
+		die("unable to open %s (%s)", filename, strerror(errno));
+	f = xmalloc(sizeof(*f));
+	f->fd = fd;
+	f->error = 0;
+	f->offset = 0;
+	SHA1_Init(&f->ctx);
+	return f;
+}
+
+int sha1write_compressed(struct sha1file *f, void *in, unsigned int size)
+{
+	z_stream stream;
+	unsigned long maxsize;
+	void *out;
+
+	memset(&stream, 0, sizeof(stream));
+	deflateInit(&stream, Z_DEFAULT_COMPRESSION);
+	maxsize = deflateBound(&stream, size);
+	out = xmalloc(maxsize);
+
+	/* Compress it */
+	stream.next_in = in;
+	stream.avail_in = size;
+
+	stream.next_out = out;
+	stream.avail_out = maxsize;
+
+	while (deflate(&stream, Z_FINISH) == Z_OK)
+		/* nothing */;
+	deflateEnd(&stream);
+
+	size = stream.total_out;
+	sha1write(f, out, size);
+	free(out);
+	return size;
+}
+
+
diff --git a/csum-file.h b/csum-file.h
new file mode 100644
index 0000000..1086f04
--- /dev/null
+++ b/csum-file.h
@@ -0,0 +1,17 @@
+#ifndef CSUM_FILE_H
+#define CSUM_FILE_H
+
+/* A SHA1-protected file */
+struct sha1file {
+	int fd, error;
+	unsigned long offset;
+	SHA_CTX ctx;
+	unsigned char buffer[8192];
+};
+
+extern struct sha1file *sha1create(const char *fmt, ...);
+extern int sha1close(struct sha1file *);
+extern int sha1write(struct sha1file *, void *, unsigned int);
+extern int sha1write_compressed(struct sha1file *, void *, unsigned int);
+
+#endif
diff --git a/pack-objects.c b/pack-objects.c
index bc8bb95..f0c84c9 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "object.h"
 #include "delta.h"
+#include "csum-file.h"
 
 static const char pack_usage[] = "git-pack-objects [--window=N] [--depth=N] base-name < object-list";
 
@@ -29,51 +30,6 @@
 static int nr_objects = 0, nr_alloc = 0;
 static const char *base_name;
 
-struct myfile {
-	int fd;
-	unsigned long chars;
-	unsigned char buffer[8192];
-};
-
-static FILE *create_file(const char *suffix)
-{
-	static char filename[PATH_MAX];
-	unsigned len;
-
-	len = snprintf(filename, PATH_MAX, "%s.%s", base_name, suffix);
-	if (len >= PATH_MAX)
-		die("you wascally wabbit, you");
-	return fopen(filename, "w");
-}
-
-static unsigned long fwrite_compressed(void *in, unsigned long size, FILE *f)
-{
-	z_stream stream;
-	unsigned long maxsize;
-	void *out;
-
-	memset(&stream, 0, sizeof(stream));
-	deflateInit(&stream, Z_DEFAULT_COMPRESSION);
-	maxsize = deflateBound(&stream, size);
-	out = xmalloc(maxsize);
-
-	/* Compress it */
-	stream.next_in = in;
-	stream.avail_in = size;
-
-	stream.next_out = out;
-	stream.avail_out = maxsize;
-
-	while (deflate(&stream, Z_FINISH) == Z_OK)
-		/* nothing */;
-	deflateEnd(&stream);
-
-	size = stream.total_out;
-	fwrite(out, size, 1, f);
-	free(out);
-	return size;
-}
-
 static void *delta_against(void *buf, unsigned long size, struct object_entry *entry)
 {
 	unsigned long othersize, delta_size;
@@ -92,7 +48,7 @@
 	return delta_buf;
 }
 
-static unsigned long write_object(FILE *f, struct object_entry *entry)
+static unsigned long write_object(struct sha1file *f, struct object_entry *entry)
 {
 	unsigned long size;
 	char type[10];
@@ -121,8 +77,8 @@
 	}
 	datalen = htonl(size);
 	memcpy(header+1, &datalen, 4);
-	fwrite(header, hdrlen, 1, f);
-	datalen = fwrite_compressed(buf, size, f);
+	sha1write(f, header, hdrlen);
+	datalen = sha1write_compressed(f, buf, size);
 	free(buf);
 	return hdrlen + datalen;
 }
@@ -130,7 +86,7 @@
 static void write_pack_file(void)
 {
 	int i;
-	FILE *f = create_file("pack");
+	struct sha1file *f = sha1create("%s.%s", base_name, "pack");
 	unsigned long offset = 0;
 	unsigned long mb;
 
@@ -139,7 +95,7 @@
 		entry->offset = offset;
 		offset += write_object(f, entry);
 	}
-	fclose(f);
+	sha1close(f);
 	mb = offset >> 20;
 	offset &= 0xfffff;
 }
@@ -147,7 +103,7 @@
 static void write_index_file(void)
 {
 	int i;
-	FILE *f = create_file("idx");
+	struct sha1file *f = sha1create("%s.%s", base_name, "idx");
 	struct object_entry **list = sorted_by_sha;
 	struct object_entry **last = list + nr_objects;
 	unsigned int array[256];
@@ -168,7 +124,7 @@
 		array[i] = htonl(next - sorted_by_sha);
 		list = next;
 	}
-	fwrite(array, 256, sizeof(int), f);
+	sha1write(f, array, 256 * sizeof(int));
 
 	/*
 	 * Write the actual SHA1 entries..
@@ -177,10 +133,10 @@
 	for (i = 0; i < nr_objects; i++) {
 		struct object_entry *entry = *list++;
 		unsigned int offset = htonl(entry->offset);
-		fwrite(&offset, 4, 1, f);
-		fwrite(entry->sha1, 20, 1, f);
+		sha1write(f, &offset, 4);
+		sha1write(f, entry->sha1, 20);
 	}
-	fclose(f);
+	sha1close(f);
 }
 
 static void add_object_entry(unsigned char *sha1, unsigned int hash)
diff --git a/unpack-objects.c b/unpack-objects.c
index 9da3ac8..91a71c5 100644
--- a/unpack-objects.c
+++ b/unpack-objects.c
@@ -61,7 +61,7 @@
 	unsigned int nr;
 	int i;
 
-	if (index_size < 4*256)
+	if (index_size < 4*256 + 20)
 		return error("index file too small");
 	nr = 0;
 	for (i = 0; i < 256; i++) {
@@ -70,11 +70,14 @@
 			return error("non-monotonic index");
 		nr = n;
 	}
-	if (index_size != 4*256 + nr * 24) {
-		printf("index_size=%lu, expected %u (%u)\n",
-		       index_size, 4*256 + nr * 24, nr);
+	/*
+	 * Total size:
+	 *  - 256 index entries 4 bytes each
+	 *  - 24-byte entries * nr (20-byte sha1 + 4-byte offset)
+	 *  - 20-byte SHA1 file checksum
+	 */
+	if (index_size != 4*256 + nr * 24 + 20)
 		return error("wrong index file size");
-	}
 
 	nr_entries = nr;
 	pack_list = xmalloc(nr * sizeof(struct pack_entry *));
