diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-09-13 20:07:56 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-09-13 20:07:57 +0300 |
commit | 331f20d52df2fd5eb4bea4a9e14a368472f32819 (patch) | |
tree | 2aa5b04125bfde2d26ea07e9723f80251a8aea0f /builtin/index-pack.c | |
parent | c52a02a0f0025df0e83ba00dc469df0dc8838b5e (diff) | |
parent | e0b8c84240037a592c5bd5f18fc382a98a323bea (diff) |
Merge branch 'ew/hash-with-openssl-evp'
Fix-up new-ish code to support OpenSSL EVP API.
* ew/hash-with-openssl-evp:
treewide: fix various bugs w/ OpenSSL 3+ EVP API
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r-- | builtin/index-pack.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 006ffdc9c5..dda94a9f46 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1166,6 +1166,7 @@ static void parse_pack_objects(unsigned char *hash) struct ofs_delta_entry *ofs_delta = ofs_deltas; struct object_id ref_delta_oid; struct stat st; + git_hash_ctx tmp_ctx; if (verbose) progress = start_progress( @@ -1202,7 +1203,9 @@ static void parse_pack_objects(unsigned char *hash) /* Check pack integrity */ flush(); - the_hash_algo->final_fn(hash, &input_ctx); + the_hash_algo->init_fn(&tmp_ctx); + the_hash_algo->clone_fn(&tmp_ctx, &input_ctx); + the_hash_algo->final_fn(hash, &tmp_ctx); if (!hasheq(fill(the_hash_algo->rawsz), hash)) die(_("pack is corrupted (SHA1 mismatch)")); use(the_hash_algo->rawsz); |