Skip to content

Commit

Permalink
Replace open-coded version of hash_sha1_file()
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Rene Scharfe authored and Junio C Hamano committed Oct 15, 2006
1 parent 972a915 commit 7cfb5f3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7cfb5f3

Please sign in to comment.