LWN: Comments on "Updating the Git protocol for SHA-256" https://lwn.net/Articles/823352/ This is a special feed containing comments posted to the individual LWN article titled "Updating the Git protocol for SHA-256". en-us Thu, 09 Oct 2025 17:10:25 +0000 Thu, 09 Oct 2025 17:10:25 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Updating the Git protocol for SHA-256 https://lwn.net/Articles/825620/ https://lwn.net/Articles/825620/ nix <div class="FormattedComment"> OK, you live and learn: git:// allows pack reception! I clearly never read that part of the git-daemon manpage :)<br> </div> Wed, 08 Jul 2020 19:28:27 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/825618/ https://lwn.net/Articles/825618/ nix <div class="FormattedComment"> <font class="QuotedText">&gt; And yes, I&#x27;m working with upstream on this.</font><br> <p> By this point, as a mere observer, I would say you *are* one of upstream. You&#x27;re one of the two people doing most of the bup commits and have been for over a year now. :)<br> <p> </div> Wed, 08 Jul 2020 19:22:46 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824637/ https://lwn.net/Articles/824637/ johill <div class="FormattedComment"> I should, however, mention that due to git&#x27;s object format (&quot;&lt;type&gt; &lt;length&gt;\x00&lt;data&gt;&quot;) other tools can architecturally have an advantage on throughput. Due to the header, bup has to run the content-based splitting first, and then start hashing the object only once it knows how long it is. If you don&#x27;t have the limitation of the git storage format, you can do without such a header and do both hashes in parallel, stopping once you find the split point. I&#x27;ve been thinking about mitigating that with threading, but it&#x27;s a bit difficult right now in bup&#x27;s software architecture. (Incidentally, python is not the issue here, since the hash splitting is entirely in C in my tree, so can run outside the GIL.)<br> </div> Sat, 27 Jun 2020 07:48:20 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824636/ https://lwn.net/Articles/824636/ johill <div class="FormattedComment"> I&#x27;m not aware of that. It would probably mean a new object type in git, or such, I haven&#x27;t really thought about it.<br> <p> However, it&#x27;s not nearly as bad in git? You&#x27;re not storing hundreds of thousands of files in a folder in git, presumably? :-) Not sure how much interest there would be in git on that.<br> </div> Sat, 27 Jun 2020 07:42:59 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824633/ https://lwn.net/Articles/824633/ pabs <div class="FormattedComment"> Is anyone working on adding treesplitting to git itself? Your docs mention that the tree duplication issue occurs with git too.<br> </div> Sat, 27 Jun 2020 07:31:49 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824632/ https://lwn.net/Articles/824632/ johill <div class="FormattedComment"> Thinking about ransomware, I think you should be able to configure permissions on restic&#x27;s use of AWS/S3 to prevent deletion? There&#x27;s a use case that&#x27;s more interesting to asymmetric encryption - not letting the machine that&#x27;s doing the backup access its own old data, in case it&#x27;s compromised, as mentioned on that ticket. Maybe you can even configure the S3 bucket to be read-only of sorts (e.g. by storing in deep archive or glacier, and not let the IAM account do any restores from there), but I don&#x27;t know how much or what restic needs to read out of the repo to make a new backup.<br> <p> Borg&#x27;s encryption design seems to have one issue - as far as I can tell, the &quot;content-based chunker&quot; has a very small key (they claim 32 bits, but say it goes linearly though the algorithm, so not all of those bits eventually matter), which would seem to allow fingerprinting attacks (&quot;you have this chain of chunk sizes, so you must have this file&quot;). Borg also has been debating S3 storage for years without any movement.<br> <p> <p> Ultimately I landed with bup (that I had used previously), and have been working on adding to bup both (asymmetric) encryption support and AWS/S3 storage; in the latter case you can effectively make your repo append-only (to the machine that&#x27;s making the backup), i.e. AWS permissions ensure that it cannot actually delete the data. It could delete some metadata tables etc. but that&#x27;s mostly recoverable (though I haven&#x27;t written the recovery tools yet), apart from the ref names (which are only stored in dynamoDB for consistency reasons, S3 has almost no consistency guarantees.)<br> <p> It&#x27;s probably not ready for mainline yet (and we&#x27;re busy finishing the python 3 port in mainline), but I&#x27;ve actually used it recently to begin storing some of my backups (currently ~850GiB) in S3 Deep Archive.<br> <p> Configuration references:<br> <a href="https://github.com/jmberg/bup/blob/master/Documentation/bup-encrypted.7.md">https://github.com/jmberg/bup/blob/master/Documentation/b...</a><br> <a href="https://github.com/jmberg/bup/blob/master/Documentation/bup-aws.7.md">https://github.com/jmberg/bup/blob/master/Documentation/b...</a><br> <p> Some design documentation is in the code:<br> <a href="https://github.com/jmberg/bup/blob/master/lib/bup/repo/encrypted.py">https://github.com/jmberg/bup/blob/master/lib/bup/repo/en...</a><br> <p> If you use it, there are two other things in my tree that you&#x27;d probably want:<br> <p> 1) with a lot of data, the content-based splitting on 13 bits results in far too much metadata (and storage isn&#x27;t that expensive anymore), so you&#x27;d want to increase that. Currently in master that&#x27;s not configurable, but I changed that: <a href="https://github.com/jmberg/bup/blob/master/Documentation/bup-settings.7.md">https://github.com/jmberg/bup/blob/master/Documentation/b...</a><br> <p> 2) if you have lots of large directories (e.g. maildir) then minor changes to those currently consumes a significant amount of storage space since the entire folder is saved again (the list of files). I have &quot;treesplit&quot; in my code that allows splitting up those trees (again, content-based) to avoid that issue, which for my largest maildir of ~400k files brings down the amount of new data saved from close to 10 MB (after compression) to &lt;&lt;50kB when a new email is written there. Looks like I didn&#x27;t document that yet, but I should add it here: <a href="https://github.com/jmberg/bup/blob/master/Documentation/bup-settings.7.md">https://github.com/jmberg/bup/blob/master/Documentation/b...</a>. The commit describes it a bit now: <a href="https://github.com/jmberg/bup/commit/44006daca4786abe31e32a969a08778133496663">https://github.com/jmberg/bup/commit/44006daca4786abe31e3...</a><br> <p> <p> And yes, I&#x27;m working with upstream on this.<br> </div> Sat, 27 Jun 2020 07:19:37 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824629/ https://lwn.net/Articles/824629/ pabs <div class="FormattedComment"> borg is the other modern chunking backup system:<br> <p> <a href="https://borgbackup.github.io/borgbackup/">https://borgbackup.github.io/borgbackup/</a><br> <p> There is also bup, much more closely related to git:<br> <p> <a href="https://github.com/bup/bup">https://github.com/bup/bup</a><br> <p> </div> Sat, 27 Jun 2020 05:46:09 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824627/ https://lwn.net/Articles/824627/ ras <div class="FormattedComment"> Your comment led me look up restic, and I was thinking &quot;finally, this is it&quot;, then I discovered <a href="https://github.com/restic/restic/issues/187">https://github.com/restic/restic/issues/187</a>. With ransomware a thing it&#x27;s a major omission, and sadly there&#x27;s been two years with no movement. Shame.<br> <p> But you say it has friends?<br> </div> Sat, 27 Jun 2020 05:14:41 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824599/ https://lwn.net/Articles/824599/ plugwash <div class="FormattedComment"> Most vulnerabilities in hashes seem to incrementally chip away at the strength. Not be immediate and complete breaks. So having more bits of headroom gives you more time from when the cryptographers start chipping away at the strength to when you have a practical breaks.<br> <p> I would also expect hash functions with a larger internal state to be more secure even if their output size is the same. Even if the difficulty of finding a collision is similar the collision is less useful if you can&#x27;t just tack on an arbitary suffix.<br> </div> Fri, 26 Jun 2020 15:45:49 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824547/ https://lwn.net/Articles/824547/ smitty_one_each <div class="FormattedComment"> One might have been tempted to consider leaving git as-is, and calling the SHA-256 version &quot;got&quot;, and then using a script to walk the tree with checkouts and commits to convert the repo from git to got.<br> <p> Which is probably harder than I realize to accomplish.<br> </div> Fri, 26 Jun 2020 11:31:42 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824493/ https://lwn.net/Articles/824493/ pj <div class="FormattedComment"> ...all valid criticisms, but I&#x27;ve yet to see an alternative with equivalent functionality and more widespread support. If you know of one, I&#x27;d love to hear about it! Though as you say, multihash is still fairly young so would likely welcome feedback that would help adoption/functionality/usability.<br> </div> Thu, 25 Jun 2020 17:02:47 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824492/ https://lwn.net/Articles/824492/ kmweber <div class="FormattedComment"> This was interesting to me because, deapite being obvious in retrospect, it never occurred to me that git&#x27;s use of hashes guarantees integrity of the revision history. I always saw it solely as a means of implementing a content-addressable store.<br> </div> Thu, 25 Jun 2020 16:36:15 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824444/ https://lwn.net/Articles/824444/ grawity <p>Well, if the password is actually empty, at least OpenSSH will outright let you <em>skip</em> password-based authentication &ndash; no password prompts to be shown. I have seen actual Git and Hg servers which use this (if I remember correctly, the OpenSolaris Hg repository used to be served exactly this way).</p> <p>Sure you could argue that you still need a known username, but that can be simply included in the git+ssh:// URL (like people <strong>already do</strong> with <code>git@github.com</code>).</p> <p>(Still, even if you <em>had</em> to press Enter at a blank password prompt, that's how CVS <a href="https://durak.org/sean/pubs/software/cvsbook/Anonymous-Access.html">pserver</a> used to work and everyone accepted it as "anonymous access" all the same.)</p> Thu, 25 Jun 2020 09:09:00 +0000 No capabilities only for "dumb" HTTP protocol https://lwn.net/Articles/824438/ https://lwn.net/Articles/824438/ jnareb <div class="FormattedComment"> <font class="QuotedText">&gt; This provides a clear path forward for the most commonly used Git protocol (git://). It does not, however, address less desirable methods such as communicating over HTTP (http://), since that method does not provide capabilities.</font><br> <p> Actually Git protocol (with capabilities) is used with three transport methods: bare TCP (git://) - unauthenticated and nowadays rarely used, SSH, and &quot;smart&quot; HTTP(s) (http:// and https://). If you use GitHub, Bitbucket, GitLab or any other hosting site, you are using encapsulated git protocol whether you use SSH or https:// URLs.<br> <p> It is only *&quot;dumb&quot; HTTP* that has problems, that relies on WebDAV-capable web server and `git update-server-info` to be run on each repository update (usually from hooks). &quot;Smart&quot; HTTP protocol relies on `git http-server` CGI script or equivalent.<br> <p> So in my opinion it should be s/such as communicating over HTTP/such as communicating over &quot;dumb&quot; HTTP/<br> </div> Thu, 25 Jun 2020 08:05:21 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824429/ https://lwn.net/Articles/824429/ newren <div class="FormattedComment"> <font class="QuotedText">&gt; Arguably you still have time -- most of the work to date has been fixing the git code to where they can abstract away the hash algorithm at all (previously the code encoded object IDs as a raw char[40] all over). IIRC, at this stage, there&#x27;s still no non-experimental support for SHA-256 per se.</font><br> <p> I don&#x27;t think that&#x27;s quite a fair characterization; as far as I understand, there&#x27;s been quite a bit of sha-256 specific work -- the choice of sha-256 was made two years ago (and not earlier) because that was the point at which brian needed a decision to be made to proceed further on the transition plan. When someone tried to propose a different hash six months ago, this is part of what brian had to say:<br> <p> &quot;Because we decided some time ago, I&#x27;ve sent in a bunch of patches to our<br> testsuite to make it work with SHA-256. Some of these patches are<br> general, in that they make the tests generate values which are used, or<br> they are specific to the length of the hash algorithm. Others use<br> specific hash values, and changing the hash algorithm will require<br> recomputing all of these values.<br> <p> Absent a compelling security reason to abandon SHA-256, such as a<br> significant previously unknown cryptographic weakness, I don&#x27;t plan to<br> reimplement all of this work. Updating our testsuite to work<br> successfully with SHA-256 has taken a huge amount of time, and this work<br> has been entirely done on my own free time because I want the Git<br> project to be successful. That doesn&#x27;t even include the contributions<br> of others who have reviewed, discussed, and contributed to the current<br> work and transition plan.&quot;<br> (Source: <a href="https://lore.kernel.org/git/20191223011306.GF163225@camp.crustytoothpaste.net/">https://lore.kernel.org/git/20191223011306.GF163225@camp....</a>)<br> <p> <font class="QuotedText">&gt; Perhaps this goes without saying, but since this is the kind of thing that can get very bikesheddy, performance numbers and strong arguments specifically refuting their reasons will probably do better than opinions.</font><br> <p> Yes, absolutely. And someone as capable as brian to volunteer to do all the work brian has been doing for the last few years, or some magic to convince brian to throw away part of his work and happily redo it for a new hash. I personally know almost nothing about all these hashes and have not been involved in the hash transition plan, but if blake3 is still impressive enough to you that you still want to try to change brian&#x27;s and possibly others&#x27; minds, I can at least point you to the thread where the sha256 decision was initially made. It may help you craft your arguments relative to performance and other characteristics. See it over here: <a href="https://lore.kernel.org/git/20180609224913.GC38834@genre.crustytoothpaste.net/">https://lore.kernel.org/git/20180609224913.GC38834@genre....</a><br> </div> Thu, 25 Jun 2020 06:52:44 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824427/ https://lwn.net/Articles/824427/ draco <div class="FormattedComment"> I was surprised they didn&#x27;t switch to using Base64 instead of hex. You&#x27;d need only 43 characters (vs today&#x27;s 40) instead of 64. Prefix one more character for the hash method and you only add 4. [Yes, standard Base64 would always append an &#x27;=&#x27;, but since the input is fixed-length, there&#x27;s no need to include it.]<br> <p> But instead it looks like they&#x27;ll stick with hex and disambiguate via ^{sha1} and ^{sha256} suffixes.<br> </div> Thu, 25 Jun 2020 04:41:32 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824425/ https://lwn.net/Articles/824425/ draco <div class="FormattedComment"> Arguably you still have time -- most of the work to date has been fixing the git code to where they can abstract away the hash algorithm at all (previously the code encoded object IDs as a raw char[40] all over). IIRC, at this stage, there&#x27;s still no non-experimental support for SHA-256 per se.<br> <p> Here&#x27;s the criteria they used to choose SHA-256, from git.git/Documentation/technical/hash-function-transition.txt:<br> <p> 1. A 256-bit hash (long enough to match common security practice; not<br> excessively long to hurt performance and disk usage).<br> <p> 2. High quality implementations should be widely available (e.g., in<br> OpenSSL and Apple CommonCrypto).<br> <p> 3. The hash function&#x27;s properties should match Git&#x27;s needs (e.g. Git<br> requires collision and 2nd preimage resistance and does not require<br> length extension resistance).<br> <p> 4. As a tiebreaker, the hash should be fast to compute (fortunately<br> many contenders are faster than SHA-1).<br> <p> Looking at the git history of the file, their candidates included: SHA-256, SHA-512/256, SHA-256x16, K12, and BLAKE2bp-256.<br> <p> From the commit message in which they down-selected to SHA-256:<br> <p> &quot;From a security perspective, it seems that SHA-256, BLAKE2, SHA3-256, K12, and so on are all believed to have similar security properties. All are good options from a security point of view.<br> <p> SHA-256 has a number of advantages:<br> <p> * It has been around for a while, is widely used, and is supported by<br> just about every single crypto library (OpenSSL, mbedTLS, CryptoNG,<br> SecureTransport, etc).<br> <p> * When you compare against SHA1DC, most vectorized SHA-256<br> implementations are indeed faster, even without acceleration.<br> <p> * If we&#x27;re doing signatures with OpenPGP (or even, I suppose, CMS),<br> we&#x27;re going to be using SHA-2, so it doesn&#x27;t make sense to have our<br> security depend on two separate algorithms when either one of them<br> alone could break the security when we could just depend on one.<br> <p> So SHA-256 it is.&quot;<br> <p> Perhaps this goes without saying, but since this is the kind of thing that can get very bikesheddy, performance numbers and strong arguments specifically refuting their reasons will probably do better than opinions.<br> </div> Thu, 25 Jun 2020 04:23:33 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824313/ https://lwn.net/Articles/824313/ nevyn <div class="FormattedComment"> Hmm, as someone who has done a bunch of work with hashes over the last couple of years I&#x27;d not heard of multihash before, and looking at <a href="https://multiformats.io/#projects-using-multiformats">https://multiformats.io/#projects-using-multiformats</a> it seems the main user is still just ipfs. This wouldn&#x27;t necessarily be bad if it was new and gaining usage, but it&#x27;s more worrying given it&#x27;s been around over half a decade and supposed to be established.<br> <p> Another similar point is the table itself, the hashes added are done ad hoc when someone uses them and wants to use multihash ... again, fine if the project is very new and gaining traction but much less good if the project is established and you go see that none of <a href="https://github.com/dgryski/dgohash">https://github.com/dgryski/dgohash</a> are there. I understand it&#x27;s volunteer based contributions but if you want people to actually use your std. it&#x27;s going to be much easier if they can use it without having to self register well known/used decade old types.<br> <p> Then there&#x27;s the format itself. I understand that hashes are variable length but showing abbreviated hashes is very well known at this point. A new git repo. shows 7 characters for the --abbrev hash, ansible with over 50k commits only shows 10 (and even then github only shows 7), and they want to add &quot;1220&quot; to the front of that? And they really want you to show it to the user all the time? Even if abbreviated hashes weren&#x27;t a thing, most users are going to think it&#x27;s a bit weird if literally all the hashes they see start with the same 4 hex characters (at a minimum -- using blake2b will eat 6, I think). I also doubt many developers would want to store the hases natively, because it doesn&#x27;t take many instances before storing the exact same byte sequence with each piece of actual data becomes more than trivial waste.<br> <p> </div> Wed, 24 Jun 2020 04:03:03 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824224/ https://lwn.net/Articles/824224/ Hattifnattar <p>No, it is not <i>known</i> to be more secure. Unfortunately with the current sate of the art this is impossible to know.</p> <p>Sure, it has bigger key space, but 256 bit already makes a random collision astronomically unlikely. The real problem are vulnerabilities. And any vulnerability found in SHA-256 is pretty much guaranteed to be present in SHA-512, and vice versa.</p> Tue, 23 Jun 2020 14:53:09 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824209/ https://lwn.net/Articles/824209/ dezgeg <div class="FormattedComment"> There is the "none" authentication method that can be used. E.g. "ssh nethack@alt.org" seems to use that. I suppose then the only thing needed is configuring the SSH server to ignore the username. <br> </div> Tue, 23 Jun 2020 12:19:29 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824202/ https://lwn.net/Articles/824202/ niner <div class="FormattedComment"> That's not really anonymous ssh, it's just ssh with a publicly known user name and password (in this case "anonymous" and "").<br> </div> Tue, 23 Jun 2020 07:20:28 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824197/ https://lwn.net/Articles/824197/ pabs <div class="FormattedComment"> "there is no such thing as unpassworded anonymous guest ssh access" doesn't appear to be true: <br> <p> <a href="https://askubuntu.com/questions/583141/passwordless-and-keyless-ssh-guest-access">https://askubuntu.com/questions/583141/passwordless-and-k...</a><br> <a href="https://singpolyma.net/2009/11/anonymous-sftp-on-ubuntu/">https://singpolyma.net/2009/11/anonymous-sftp-on-ubuntu/</a><br> <p> PS: branchable.com allows anonymous git:// pushes to wikis. <br> <p> <a href="http://ikiwiki.info/tips/untrusted_git_push/">http://ikiwiki.info/tips/untrusted_git_push/</a><br> <a href="https://ikiwiki-hosting.branchable.com/todo/anonymous_git_push/">https://ikiwiki-hosting.branchable.com/todo/anonymous_git...</a><br> </div> Tue, 23 Jun 2020 02:10:31 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824167/ https://lwn.net/Articles/824167/ xnox <div class="FormattedComment"> It feels dated to use SHA256 instead of BLAKE3.<br> <p> BLAKE3 is faster on both 32bit and 64bit arches, over big and small inputs. And for big stuff, it supports streaming validation and incremental hash updates. Such that one can verify large pack files as one is receiving them.<br> <p> I wonder if it is too late to consider BLAKE3.<br> </div> Mon, 22 Jun 2020 18:43:48 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824163/ https://lwn.net/Articles/824163/ nix <div class="FormattedComment"> You can tunnel anything over ssh, but the git protocol is meant for *anonymous* fetching -- and there is no such thing as unpassworded anonymous guest ssh access :)<br> <p> Dumb HTTP doesn't require a server -- it only needs an HTTP server that can serve files. It's much slower and transfers a lot more than the smart protocol, but if you need it you really need it. Like git bundles, it's useful getting stuff to/from networkologically constrained environments.<br> </div> Mon, 22 Jun 2020 18:08:10 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824145/ https://lwn.net/Articles/824145/ mirabilos <div class="FormattedComment"> You need dumb http because there is no git server (initially), you just have reading (and possibly writing) access to a remote repository, over http, ssh, or something. Or even local files.<br> <p> The git protocol is only used when there’s an actual server process involved, which isn’t always possible.<br> </div> Mon, 22 Jun 2020 16:02:20 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824138/ https://lwn.net/Articles/824138/ NYKevin <div class="FormattedComment"> Ugh, I have so many questions here:<br> <p> - Why do we need both dumb and smart HTTP(S)? Should the client even care what the server looks like internally?<br> - Why isn't local just a special case of rsync?<br> - The inclusion of both git and ssh in the list is questionable (you can tunnel anything over ssh, right?) but it's probably too late to fix now.<br> <p> IIRC Mercurial has a grand total of three: HTTP(S), SSH, and local.<br> </div> Mon, 22 Jun 2020 15:44:14 +0000 IANA https://lwn.net/Articles/824135/ https://lwn.net/Articles/824135/ tialaramex <div class="FormattedComment"> IANA offers a _lot_ of different procedures. Varying from Private Use and Experimental (chunks of namespace carved off entirely for users to do with as they please without talking to IANA at all) through to Standards Action (you must publish an IETF Standards Track document e.g. a Best Common Practice or an RFC explicitly designated Internet Standard) and where the namespace is hierarchically infinite or near infinite (e.g. OIDs, DNS) IANA just delegates one layer of the namespace and more or less lets the hierarchy sort it out. Technically these OIDs don't even belong to IANA (it hijacked the ones used for the Internet many years ago) but it delegates them this way anyway and it's too late for the standards organisations that minted them to say "No".<br> <p> RFC 8126 lists 10 such procedures for general use in new namespaces.<br> <p> So what Multihash are doing here sounds like a typical new IANA namespace which has an Experimental/ Private Use region (self-assigned) and then Specification Required for the rest of the namespace. You must document what you're doing, maybe with a Standards Organisation, maybe you write a white paper, maybe even you just spin up a web site with a technical rant, but you need to document it and then you get reviewed and maybe get in.<br> <p> Apparently Multihash is writing up some sort of formal document to maybe got to the IETF, but given they started in 2016 and it's not that hard they may not ever get it polished up and standardised anywhere, it's not a problem.<br> </div> Mon, 22 Jun 2020 15:37:09 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824080/ https://lwn.net/Articles/824080/ cesarb <div class="FormattedComment"> <font class="QuotedText">&gt; So, HTTP(S) is not merely a transport in git but a completely different protocol?</font><br> <p> There are actually two different http/https transports in git, the older "dumb" transport (put the files somewhere visible to the http daemon, make it export that directory through http, done), and the newer "smart" transport (which is more similar to a CGI script). So if I'm not miscounting, we have a total of six different transports in git: the "git" transport, the "dumb" http transport, the "smart" http transport, the ssh transport, the rsync transport, and the "local" transport (pointing directly to a local filesystem).<br> </div> Mon, 22 Jun 2020 14:03:23 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824063/ https://lwn.net/Articles/824063/ jezuch <div class="FormattedComment"> So, HTTP(S) is not merely a transport in git but a completely different protocol?<br> <p> Ouch.<br> <p> Also, is it really "less desirable"? AFAICT all the hosting providers are only allowing cloning via HTTPS... At least that I know of.<br> </div> Mon, 22 Jun 2020 12:16:48 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824043/ https://lwn.net/Articles/824043/ cyphar <div class="FormattedComment"> They do use variable-sized chunks (more specifically, content-defined chunking), but those chunking algorithms still require you to specify how large you want your chunks to be on average (or in restic's case, the chunking algorithm also asks what the maximum and minimum chunk sizes are). So you still have to decide on the trade-off between chunks that are too large and chunks that are too small.<br> </div> Mon, 22 Jun 2020 02:07:11 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824042/ https://lwn.net/Articles/824042/ NYKevin <div class="FormattedComment"> <font class="QuotedText">&gt; Maybe SHA-3, but that's still sort of new and less tested.</font><br> <p> This is the essential problem. There will always be shiny new hash functions that may or may not actually be secure. There will always be new threats against old functions. It is impossible to know, right now, what hash function you will need to be using in ten years' time. If you are not designing your system to regularly switch hash functions, you are not designing for security.<br> <p> That's why they are making this extensible. They have the humility to realize that we don't know what we're going to need tomorrow.<br> </div> Mon, 22 Jun 2020 01:57:16 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/824009/ https://lwn.net/Articles/824009/ pabs <div class="FormattedComment"> restic and friends use variable-sized chunks, that seems to be the way to go to me.<br> </div> Sun, 21 Jun 2020 13:46:47 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823999/ https://lwn.net/Articles/823999/ mb <div class="FormattedComment"> Pushing all problems to the user does not solve them.<br> It makes life easier for the developers, but hard for all users.<br> One should always try to avoid the need for help from users when upgrading/extending things. There are so many examples where this just made the process take forever, because so many users don't want to put the effort in. (e.g. Python 2-&gt;3).<br> </div> Sun, 21 Jun 2020 11:34:39 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823989/ https://lwn.net/Articles/823989/ Otus <div class="FormattedComment"> SHA-512 is only faster on 64-bit systems when hashing lonh enough messages. With short inputs is it slower. And of course it doubles stored hash lengths, increasing overhead.<br> <p> IMO choosing something more secure makes little sense when SHA-256 remains unbroken. Maybe SHA-3, but that's still sort of new and less tested.<br> </div> Sun, 21 Jun 2020 07:08:45 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823983/ https://lwn.net/Articles/823983/ flussence <div class="FormattedComment"> SHA-512 isn't really state of the art (it's part of SHA-2 alongside 256, and SHA-3 exists), but it is known to be both faster and more secure than SHA-256.<br> </div> Sun, 21 Jun 2020 05:32:17 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823977/ https://lwn.net/Articles/823977/ Kamilion <div class="FormattedComment"> ... I don't understand why they aren't just jumping straight to the state of the art SHA512 and calling it done for the next two decades in one fell swoop instead of "let's support lots of arbitrary extensions". How about just two.<br> Shouldn't we be taking lessons learned from wireguard into account? If we move to SHA256 we're simply kicking the can down the road a bit further, but not solving the problem. Software selection for adoption in high profile projects like this tends to drive hardware acceleration, and I'd much rather see HW vendors armtwisted into shooting for SHA512/ED25519/ChaCha20 accelerators than the current breed of ZLIB and AES-256 accelerators.<br> </div> Sun, 21 Jun 2020 02:58:11 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823968/ https://lwn.net/Articles/823968/ mathstuf <div class="FormattedComment"> <font class="QuotedText">&gt; including when ones does the short-sighted error of enshrining short prefixes of the hash anywhere that is not a throw away command line call... A bad practice that is very common among git users.</font><br> <p> "Best practice" for short usage in more permanent places includes the date (or tag description) and summary of the commit in question (which both greatly ease conflict resolution when it occurs and gives some idea of what's going on without having to copy/paste the has yourself).<br> </div> Sat, 20 Jun 2020 23:17:26 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823967/ https://lwn.net/Articles/823967/ mathstuf <div class="FormattedComment"> How big of a chunk do you think would work? Too little and the chunk hashes start to dwarf the content size. Too large and anything but trivial changes end up changing every hunk. Sure, there are massive files in repositories, but these probably fall into one of a few buckets:<br> <p> - best left to git-lfs, git-annex, or some other off-loading tool<br> - machine generated data (of some kind) that changes rarely<br> - non-text artifacts that change rarely<br> <p> I think experiments to test the actual benefits in organic Git repositories this would be interesting, but I'd rather see the hash transition happen correctly and smoothly and it sounds complicated enough as it is. And it should be laying down version numbers into formats as it needs that such another transition could leverage to ease its upgrade path too.<br> </div> Sat, 20 Jun 2020 23:14:27 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823966/ https://lwn.net/Articles/823966/ mathstuf <div class="FormattedComment"> What is to be done with commit references in commit messages and the like. I'd really like those to stay relevant…<br> </div> Sat, 20 Jun 2020 23:09:17 +0000 Updating the Git protocol for SHA-256 https://lwn.net/Articles/823951/ https://lwn.net/Articles/823951/ josh <div class="FormattedComment"> A single-character prefix would suffice to disambiguate:<br> <p> [0-9a-f]+ would be SHA-1.<br> T[0-9a-f]+ would be SHA-256<br> Pick a new capital letter [G-Z] for each new hash.<br> </div> Sat, 20 Jun 2020 20:36:15 +0000