]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Replace open-coded version of hash_sha1_file()
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>
Sun, 15 Oct 2006 12:02:18 +0000 (14:02 +0200)
committerJunio C Hamano <junkio@cox.net>
Sun, 15 Oct 2006 19:35:25 +0000 (12:35 -0700)
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c

index 66cc7679cef829bfad1bdb599800b6d603a89f52..716aef33e3a28039a8659d77d6797dc183730643 100644 (file)
@@ -671,14 +671,8 @@ static void reprepare_packed_git(void)
 
 int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long size, const char *type)
 {
-       char header[100];
        unsigned char real_sha1[20];
-       SHA_CTX c;
-
-       SHA1_Init(&c);
-       SHA1_Update(&c, header, 1+sprintf(header, "%s %lu", type, size));
-       SHA1_Update(&c, map, size);
-       SHA1_Final(real_sha1, &c);
+       hash_sha1_file(map, size, type, real_sha1);
        return hashcmp(sha1, real_sha1) ? -1 : 0;
 }