diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-10-02 07:46:27 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-10-02 07:46:27 -0700 |
| commit | ead0a050e2eddf8c67ee3404e165bffd42c6fd42 (patch) | |
| tree | 0d2d1c33bec3d1be1c99d67dec0edfc39dc861e6 /object-file.h | |
| parent | Merge branch 'jk/http-leakfixes' (diff) | |
| parent | csum-file.c: use unsafe SHA-1 implementation when available (diff) | |
| download | git-ead0a050e2eddf8c67ee3404e165bffd42c6fd42.tar.gz git-ead0a050e2eddf8c67ee3404e165bffd42c6fd42.zip | |
Merge branch 'tb/weak-sha1-for-tail-sum'
The checksum at the tail of files are now computed without
collision detection protection. This is safe as the consumer of
the information to protect itself from replay attacks checks for
hash collisions independently.
* tb/weak-sha1-for-tail-sum:
csum-file.c: use unsafe SHA-1 implementation when available
Makefile: allow specifying a SHA-1 for non-cryptographic uses
hash.h: scaffolding for _unsafe hashing variants
sha1: do not redefine `platform_SHA_CTX` and friends
pack-objects: use finalize_object_file() to rename pack/idx/etc
finalize_object_file(): implement collision check
finalize_object_file(): refactor unlink_or_warn() placement
finalize_object_file(): check for name collision before renaming
Diffstat (limited to 'object-file.h')
| -rw-r--r-- | object-file.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/object-file.h b/object-file.h index d6414610f8..81b30d269c 100644 --- a/object-file.h +++ b/object-file.h @@ -117,7 +117,13 @@ int check_object_signature(struct repository *r, const struct object_id *oid, */ int stream_object_signature(struct repository *r, const struct object_id *oid); +enum finalize_object_file_flags { + FOF_SKIP_COLLISION_CHECK = 1, +}; + int finalize_object_file(const char *tmpfile, const char *filename); +int finalize_object_file_flags(const char *tmpfile, const char *filename, + enum finalize_object_file_flags flags); /* Helper to check and "touch" a file */ int check_and_freshen_file(const char *fn, int freshen); |
