git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] alter hash function: expose test dependencies on sha1

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2017, 21:52 UTC
Message-ID
<xmqq7eysmdoq.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170728171817.21458-2-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 14 quoted lines
> DO NOT APPLY.
>
> Alter the hash function such that with this patch
> any dependency on sha1 in tests will make the test
> fail. This patch applied on master yields this list:
>
> ./t0000-basic.sh
> ....
> ./t8008-blame-formats.sh
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  sha1dc/sha1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Everybody knew and said that we need to make tests less dependent on the exact hash and in such a way that the ones that currently do would test the morally equivalent thing with a new hash before we can go forward. And everybody said that one way to start that is to build a Git with different hash function and trying to run tests.

This is the first report of doing so, and the large list above is the biggest contribution this message makes to the "let's wean ourselves off of SHA-1" journey.

Thanks for starting this.
Show 14 quoted lines
>
> diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
> index 25eded1399..e18acee9ca 100644
> --- a/sha1dc/sha1.c
> +++ b/sha1dc/sha1.c
> @@ -1756,7 +1756,7 @@ static void sha1_process(SHA1_CTX* ctx, const uint32_t block[16])
>  void SHA1DCInit(SHA1_CTX* ctx)
>  {
>  	ctx->total = 0;
> -	ctx->ihv[0] = 0x67452301;
> +	ctx->ihv[0] = 0x07452301;
>  	ctx->ihv[1] = 0xEFCDAB89;
>  	ctx->ihv[2] = 0x98BADCFE;
>  	ctx->ihv[3] = 0x10325476;
Previous: Stefan BellerNext: Stefan Beller
Message 3 of 15 in “How to migrate our test infrastructure away from sha1”
  1. 0/2 How to migrate our test infrastructure away from sha1Stefan Beller, Jul 28, 2017
  2. 1/2 alter hash function: expose test dependencies on sha1Stefan Beller, Jul 28, 2017
  3. Junio C HamanoJul 28, 2017
  4. 2/2 t6500: mark tests as SHA1 reliantStefan Beller, Jul 28, 2017
  5. Junio C HamanoJul 28, 2017
  6. Stefan BellerJul 28, 2017
  7. Junio C HamanoJul 28, 2017
  8. brian m. carlsonJul 29, 2017
  9. Junio C HamanoJul 30, 2017
  10. brian m. carlsonJul 30, 2017
  11. brian m. carlsonJul 30, 2017
  12. Ævar Arnfjörð BjarmasonJul 31, 2017
  13. Stefan BellerJul 31, 2017
  14. Stefan BellerJul 31, 2017
  15. brian m. carlsonJul 31, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.