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

Re: [RFC PATCH 10/12] sha256: add an SHA-256 implementation using libgcrypt

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 29, 2018, 23:39 UTC
Message-ID
<20180829233904.GG432229@genre.crustytoothpaste.net>
In-Reply-To
<878t4peeqa.fsf@evledraar.gmail.com>
On Wed, Aug 29, 2018 at 10:53:01AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 14 quoted lines
> 
> On Wed, Aug 29 2018, brian m. carlson wrote:
> 
> > Generally, one gets better performance out of cryptographic routines
> > written in assembly than C, and this is also true for SHA-256
> 
> It makes sense to have a libgcrypt implementation...
> 
> > In addition, most Linux distributions cannot distribute Git linked
> > against OpenSSL for licensing reasons.
> 
> ...but I'm curious to know what licensing reasons these are, e.g. Debian
> who's usually the most strict about these things distributes git linked
> to OpenSSL:
On my Debian system, that's linked to libgnutls.
The reason is section 3 of the GPLv2 (emphasis mine):
  3. You may copy and distribute the Program (or a work based on it,
  under Section 2) in object code or executable form **under the terms
  of Sections 1 and 2 above** provided that you also do one of the
  following:
  [provide source somehow]
  The source code for a work means the preferred form of the work for
  making modifications to it.  For an executable work, complete source
  code means all the source code for all modules it contains, plus any
  associated interface definition files, plus the scripts used to
  control compilation and installation of the executable.  **However, as
  a special exception, the source code distributed need not include
  anything that is normally distributed (in either source or binary
  form) with the major components (compiler, kernel, and so on) of the
  operating system on which the executable runs, unless that component
  itself accompanies the executable.**

Basically, you can only distribute binary versions of Git under the terms of the GPLv2, and you have to distribute source for the entire thing under those terms. OpenSSL is licensed incompatibly with the GPLv2, so you can't legally comply with that part, but if you use the system OpenSSL and don't distribute that OpenSSL with Git, you're exempt. This is called the system library exception.

Debian (and Red Hat, and every other Linux distro) ships Git and OpenSSL side by side on the same mirrors, and hence "that component [OpenSSL] accompanies the executable." Consequently, they can't take advantage of the exception, and must link it to a GPLv2 compatible library. Debian uses GnuTLS for libcurl, and Red Hat uses NSS.

A more comprehensive explanation of the whole thing is here: https://people.gnome.org/~markmc/openssl-and-the-gpl.html

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Ævar Arnfjörð BjarmasonNext: brian m. carlson
Message 18 of 24 in “Base SHA-256 algorithm implementation”
  1. 00/12 Base SHA-256 algorithm implementationbrian m. carlson, Aug 29, 2018
  2. 01/12 sha1-file: rename algorithm to "sha1"brian m. carlson, Aug 29, 2018
  3. 03/12 hex: introduce functions to print arbitrary hashesbrian m. carlson, Aug 29, 2018
  4. 04/12 t: add basic tests for our SHA-1 implementationbrian m. carlson, Aug 29, 2018
  5. 05/12 t: make the sha1 test-tool helper genericbrian m. carlson, Aug 29, 2018
  6. 07/12 t/helper: add a test helper to compute hash speedbrian m. carlson, Aug 29, 2018
  7. 06/12 sha1-file: add a constant for hash block sizebrian m. carlson, Aug 29, 2018
  8. 08/12 commit-graph: convert to using the_hash_algobrian m. carlson, Aug 29, 2018
  9. Derrick StoleeAug 29, 2018
  10. brian m. carlsonAug 30, 2018
  11. brian m. carlsonSep 3, 2018
  12. 09/12 Add a base implementation of SHA-256 supportbrian m. carlson, Aug 29, 2018
  13. Ævar Arnfjörð BjarmasonAug 29, 2018
  14. brian m. carlsonAug 29, 2018
  15. Derrick StoleeAug 29, 2018
  16. 10/12 sha256: add an SHA-256 implementation using libgcryptbrian m. carlson, Aug 29, 2018
  17. Ævar Arnfjörð BjarmasonAug 29, 2018
  18. brian m. carlsonAug 29, 2018
  19. 11/12 hash: add an SHA-256 implementation using OpenSSLbrian m. carlson, Aug 29, 2018
  20. 12/12 commit-graph: specify OID version for SHA-256brian m. carlson, Aug 29, 2018
  21. 02/12 sha1-file: provide functions to look up hash algorithmsbrian m. carlson, Aug 29, 2018
  22. Ævar Arnfjörð BjarmasonAug 29, 2018
  23. brian m. carlsonAug 30, 2018
  24. brian m. carlsonAug 30, 2018

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.