mirror of
https://github.com/git/git
synced 2024-08-25 10:45:59 +00:00
![Ævar Arnfjörð Bjarmason](/assets/img/avatar_default.png)
Update sha1dc from the latest version by the upstream maintainer[1]. This version includes a commit of mine which allows for replacing the local modifications done to the upstream files in git.git with macro definitions to monkeypatch it in place. It also brings in a change[2] upstream made for the breakage 2.13.0 introduced on SPARC and other platforms that forbid unaligned access[3]. This means that the code customizations done since the initial import in commit28dc98e343
("sha1dc: add collision-detecting sha1 implementation", 2017-03-16) can be done purely via Makefile definitions and by including the content of our own sha1dc_git.[ch] in sha1dc/sha1.c via a macro. 1.cc465543b3
2.33a694a9ee
3. "Git 2.13.0 segfaults on Solaris SPARC due to DC_SHA1=YesPlease being on by default" (https://public-inbox.org/git/CACBZZX6nmKK8af0-UpjCKWV4R+hV-uk2xWXVA5U+_UQ3VXU03g@mail.gmail.com/) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 lines
579 B
C
20 lines
579 B
C
/*
|
|
* This code is included at the end of sha1dc/sha1.h with the
|
|
* SHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_H macro.
|
|
*/
|
|
|
|
/*
|
|
* Same as SHA1DCFinal, but convert collision attack case into a verbose die().
|
|
*/
|
|
void git_SHA1DCFinal(unsigned char [20], SHA1_CTX *);
|
|
|
|
/*
|
|
* Same as SHA1DCUpdate, but adjust types to match git's usual interface.
|
|
*/
|
|
void git_SHA1DCUpdate(SHA1_CTX *ctx, const void *data, unsigned long len);
|
|
|
|
#define platform_SHA_CTX SHA1_CTX
|
|
#define platform_SHA1_Init SHA1DCInit
|
|
#define platform_SHA1_Update git_SHA1DCUpdate
|
|
#define platform_SHA1_Final git_SHA1DCFinal
|