Skip to content

Commit 7cfb5f3

Browse files
Rene ScharfeJunio C Hamano
authored andcommitted
Replace open-coded version of hash_sha1_file()
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 972a915 commit 7cfb5f3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

sha1_file.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,14 +671,8 @@ static void reprepare_packed_git(void)
671671

672672
int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long size, const char *type)
673673
{
674-
char header[100];
675674
unsigned char real_sha1[20];
676-
SHA_CTX c;
677-
678-
SHA1_Init(&c);
679-
SHA1_Update(&c, header, 1+sprintf(header, "%s %lu", type, size));
680-
SHA1_Update(&c, map, size);
681-
SHA1_Final(real_sha1, &c);
675+
hash_sha1_file(map, size, type, real_sha1);
682676
return hashcmp(sha1, real_sha1) ? -1 : 0;
683677
}
684678

0 commit comments

Comments
 (0)