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

Re: [PATCH 0/7] PREVIEW: Introduce DC_AND_OPENSSL_SHA1 make flag

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2017, 16:58 UTC
Message-ID
<xmqq1stl5m4l.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqq7f3d6ev1.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> The hash that names a packfile is constructed by sorting all the
> names of the objects contained in the packfile and running SHA-1
> hash over it.
Sorry, but I need to make a correction here.

This "SHA-1 over sorted object names" is a description of an ancient behaviour before 1190a1ac ("pack-objects: name pack files after trailer hash", 2013-12-05) happened. These days the pack name is the same as the csum-file checksum of the .pack contents.

This however does not change the fact that the site that feeds us a packfile is in control of the hash, hence the name we give to the resulting packfile. Unlike the use of csum-file for the trailing hash for the index file, which is only to protect against bit flipping, "SHA-1 over .pack contents" done here is used to come up with a unique name used for identification and deduplication (of the packfile, not of individual objects), and the need for protection against collision attack attempts does not change between the implementation before 1190a1ac and after that commit.

Previous: Junio C HamanoNext: Jeff King
Message 14 of 23 in “PREVIEW: Introduce DC_AND_OPENSSL_SHA1 make flag”
  1. 0/7 PREVIEW: Introduce DC_AND_OPENSSL_SHA1 make flagJohannes Schindelin, Mar 24, 2017
  2. 1/7 sha1dc: safeguard against outside definitions of BIGENDIANJohannes Schindelin, Mar 24, 2017
  3. 2/7 Makefile: optionally compile with both SHA1DC and SHA1_OPENSSLJohannes Schindelin, Mar 24, 2017
  4. Ævar Arnfjörð BjarmasonMar 25, 2017
  5. Junio C HamanoMar 30, 2017
  6. Junio C HamanoMar 30, 2017
  7. Johannes SchindelinApr 18, 2017
  8. 3/7 config: add the core.enablesha1dc settingJohannes Schindelin, Mar 24, 2017
  9. 4/7 t0013: do not skip the entire file wholesale without DC_SHA1Johannes Schindelin, Mar 24, 2017
  10. 5/7 t0013: test DC_AND_OPENSSL_SHA1, tooJohannes Schindelin, Mar 24, 2017
  11. 6/7 mingw: enable DC_AND_OPENSSL_SHA1 by defaultJohannes Schindelin, Mar 24, 2017
  12. 7/7 p0013: new test to compare SHA1DC vs OpenSSLJohannes Schindelin, Mar 24, 2017
  13. Junio C HamanoMar 25, 2017
  14. Junio C HamanoMar 25, 2017
  15. Jeff KingMar 26, 2017
  16. Junio C HamanoMar 26, 2017
  17. Jeff KingMar 27, 2017
  18. Junio C HamanoMar 27, 2017
  19. Jeff KingMar 27, 2017
  20. Junio C HamanoMar 27, 2017
  21. Johannes SchindelinMar 29, 2017
  22. Junio C HamanoMar 30, 2017
  23. Johannes SchindelinApr 18, 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.