summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-06-11 16:26:50 -0400
committerGitHub <noreply@github.com>2022-06-11 16:26:50 -0400
commit4f7b568db29456cb4cb1fc635827978ec0e404bb (patch)
tree06e0a54430a8cf2c24468229186e40f4f74a032d
parent4f0ee02fc2c165b36c32d96034d60b35cf021a9c (diff)
parenta3f9617bcf8154cee6ffbf873580788791135a03 (diff)
downloadlibgit2-4f7b568db29456cb4cb1fc635827978ec0e404bb.tar.gz
Merge pull request #6291 from libgit2/cmn/midx-no-hash
midx: do not verify the checksum on load
-rw-r--r--src/libgit2/midx.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/libgit2/midx.c b/src/libgit2/midx.c
index 98e661cf1..67eab9acb 100644
--- a/src/libgit2/midx.c
+++ b/src/libgit2/midx.c
@@ -179,7 +179,6 @@ int git_midx_parse(
uint32_t i;
off64_t last_chunk_offset, chunk_offset, trailer_offset;
size_t checksum_size;
- unsigned char checksum[GIT_HASH_SHA1_SIZE];
int error;
struct git_midx_chunk chunk_packfile_names = {0},
chunk_oid_fanout = {0},
@@ -217,11 +216,6 @@ int git_midx_parse(
return midx_error("wrong index size");
memcpy(idx->checksum, data + trailer_offset, checksum_size);
- if (git_hash_buf(checksum, data, (size_t)trailer_offset, GIT_HASH_ALGORITHM_SHA1) < 0)
- return midx_error("could not calculate signature");
- if (memcmp(checksum, idx->checksum, checksum_size) != 0)
- return midx_error("index signature mismatch");
-
chunk_hdr = data + sizeof(struct git_midx_header);
last_chunk = NULL;
for (i = 0; i < hdr->chunks; ++i, chunk_hdr += 12) {