Skip to contentSkip to conversation

manual: some hashes-related clarifications (branch yem/manual)

PATCH New Yann E. MORIN 2 participants 5 messages May 3, 2015 – May 4, 2015

lore
Share & tools
lore
#0 lore raw

v2 cover manual: some hashes-related clarifications (branch yem/manual)

Hello All!

This small, long-overdue series adds some clarifications about the use of hashes:
- first, md5 hashes are documented
- second, a note explains when adding hashes for GitHub-hosted packages

Changes v1 -> v2:
- fix merge-gone-wild (Arnout)
- clarify and clean-up what hash we prefer (Arnout)
- typoes (Arnout)

Regards,
Yann E. MORIN.

The following changes since commit e2d3e1de84fa4a6f9af997d064fa1bcbdddc3ff2:

poppler: help finding libtiff in static linking scenarios (2015-05-03 16:33:46 +0200)

are available in the git repository at:

git://git.busybox.net/~ymorin/git/buildroot yem/manual

for you to fetch changes up to 65108fc814c42059f26b7690ccd505c0ebb6afb5:

manual: Add notes about GitHub and hashes (2015-05-03 17:10:55 +0200)

----------------------------------------------------------------
Maxime Hadjinlian (1):
manual: Add notes about GitHub and hashes

Yann E. MORIN (1):
docs/manual: also document md5 hash

 docs/manual/adding-packages-directory.txt | 36 +++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 11 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v2 1/2 docs/manual: also document md5 hash

We accept an md5 hash, but only if coming from upstream, and if also accompanied with a stronger hash.

Cc Maxime Hadjinlian <[email protected]>
Cc Samuel Martin <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---
Chanves v1 -> v2:
- fix merge-gone-wild (Arnout)
- clarify that we prefer sha256 for locally computed hashes (Arnout)
- make the comment in the example aligned with current customs (Arnout)
- typoes in commit log (Arnout)

---
 docs/manual/adding-packages-directory.txt | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)
docs/manual/adding-packages-directory.txt +18 -11
index 639003f..6c478c2 100644
@@ -415,9 +415,10 @@ The format of this file is one line for each file for which to check the
 hash, each line being space-separated, with these three fields:
 
 * the type of hash, one of:
-** +sha1+, +sha224+, +sha256+, +sha384+, +sha512+, +none+
+** +md5+, +sha1+, +sha224+, +sha256+, +sha384+, +sha512+, +none+
 * the hash of the file:
 ** for +none+, one or more non-space chars, usually just the string +xxx+
+** for +md5+, 32 hexadecimal characters
 ** for +sha1+, 40 hexadecimal characters
 ** for +sha224+, 56 hexadecimal characters
 ** for +sha256+, 64 hexadecimal characters
@@ -431,14 +432,17 @@ lines are ignored.
 There can be more than one hash for a single file, each on its own line. In
 this case, all hashes must match.
 
+.Note
 Ideally, the hashes stored in this file should match the hashes published by
 upstream, e.g. on their website, in the e-mail announcement... If upstream
-provides more than one type of hash (say, +sha1+ and +sha512+), then it is
+provides more than one type of hash (e.g. +sha1+ and +sha512+), then it is
 best to add all those hashes in the +.hash+ file. If upstream does not
-provide any hash, then compute at least one yourself, and mention this in a
-comment line above the hashes.
+provide any hash, or only provides an +md5+ hash, then compute at least one
+strong hash yourself (preferably +sha256+, but not +md5+), and mention
+this in a comment line above the hashes.
 
-*Note:* the number of spaces does not matter, so one can use spaces to
+.Note
+The number of spaces does not matter, so one can use spaces (or tabs) to
 properly align the different fields.
 
 The +none+ hash type is reserved to those archives downloaded from a
@@ -446,20 +450,23 @@ repository, like a 'git clone', a 'subversion checkout'... or archives
 downloaded with the xref:github-download-url[github helper].
 
 The example below defines a +sha1+ and a +sha256+ published by upstream for
-the main +libfoo-1.2.3.tar.bz2+ tarball, plus two locally-computed hashes,
-a +sha256+ for a downloaded patch, a +sha1+ for a downloaded binary blob,
-and an archive with no hash:
+the main +libfoo-1.2.3.tar.bz2+ tarball, an +md5+ from upstream and a
+locally-computed +sha256+ hashes for a binary blob, a +sha256+ for a
+downloaded patch, and an archive with no hash:
 
 ----
 # Hashes from: http://www.foosoftware.org/download/libfoo-1.2.3.tar.bz2.{sha1,sha256}:
 sha1   486fb55c3efa71148fe07895fd713ea3a5ae343a                         libfoo-1.2.3.tar.bz2
 sha256 efc8103cc3bcb06bda6a781532d12701eb081ad83e8f90004b39ab81b65d4369 libfoo-1.2.3.tar.bz2
 
-# No upstream hashes for the following:
+# md5 from: http://www.foosoftware.org/download/libfoo-1.2.3.tar.bz2.md5, sha256 locally computed:
+md5    2d608f3c318c6b7557d551a5a09314f03452f1a1                         libfoo-data.bin
+sha256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b libfoo-data.bin
+
+# Locally computed:
 sha256 ff52101fb90bbfc3fe9475e425688c660f46216d7e751c4bbdb1dc85cdccacb9 libfoo-fix-blabla.patch
-sha1   2d608f3c318c6b7557d551a5a09314f03452f1a1                         libfoo-data.bin
 
-# Explicitly no hash for that file, comes from a git-clone:
+# No hash for 1234, comes from the github-helper:
 none   xxx                                                              libfoo-1234.tar.gz
 ----
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 1/2 docs/manual: also document md5 hash

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

We accept an md5 hash, but only if coming from upstream, and if also accompanied with a stronger hash.

Cc Maxime Hadjinlian <[email protected]>
Cc Samuel Martin <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Quoted 6 lines

---
Chanves v1 -> v2:
- fix merge-gone-wild (Arnout)
- clarify that we prefer sha256 for locally computed hashes (Arnout)
- make the comment in the example aligned with current customs (Arnout)
- typoes in commit log (Arnout)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v2 2/2 manual: Add notes about GitHub and hashes

In reply to Yann E. MORIN

From: Maxime Hadjinlian <[email protected]>

We can't take hashes from GitHub, unless the tarball has been uploaded by the maintainer, otherwise it is generated and may change over time, which renders hash files useless.

---
v3 -> v4 :
- typo (Arnout)

v2 -> v3 (YEM):
- move the block down, to be with with the other "note"
- add reference to the GitHub helper
- small grammatical fix s/automated/automatically/

v1 -> v2:
- Add changes as requested by Yann E. Morin
- Reword the comment on released tarball

---
 docs/manual/adding-packages-directory.txt | 7 +++++++
 1 file changed, 7 insertions(+)
docs/manual/adding-packages-directory.txt +7 -0
index 6c478c2..fb3764e 100644
@@ -442,6 +442,13 @@ strong hash yourself (preferably +sha256+, but not +md5+), and mention
 this in a comment line above the hashes.
 
 .Note
+If +libfoo+ is from GitHub (see xref:github-download-url[] for details), we
+can only accept a +.hash+ file if the package is a released (e.g. uploaded
+by the maintainer) tarball. Otherwise, the automatically generated tarball
+may change over time, and thus its hashes may be different each time it is
+downloaded, making the +.hash+ file irrelevant for that tarball.
+
+.Note
 The number of spaces does not matter, so one can use spaces (or tabs) to
 properly align the different fields.
 
Signature · 1 line
1.9.1
#4 lore raw

PATCH v2 2/2 manual: Add notes about GitHub and hashes

Quoted 34 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

From: Maxime Hadjinlian <[email protected]>
We can't take hashes from GitHub, unless the tarball has been uploaded by the maintainer, otherwise it is generated and may change over time, which renders hash files useless.

---
v3 -> v4 :
- typo (Arnout)

v2 -> v3 (YEM):
- move the block down, to be with with the other "note"
- add reference to the GitHub helper
- small grammatical fix s/automated/automatically/

v1 -> v2:
- Add changes as requested by Yann E. Morin
- Reword the comment on released tarball

---
 docs/manual/adding-packages-directory.txt | 7 +++++++
 1 file changed, 7 insertions(+)
docs/manual/adding-packages-directory.txt +0 -0
index 6c478c2..fb3764e 100644

docs/manual/adding-packages-directory.txt strong hash yourself (preferably +sha256+, but not +md5+), and mention · line 449

Quoted 8 lines
docs/manual/adding-packages-directory.txt +5 -0
@@ -442,6 +442,13 @@ strong hash yourself (preferably +sha256+, but not +md5+), and mention
 this in a comment line above the hashes.
 
 .Note
+If +libfoo+ is from GitHub (see xref:github-download-url[] for details), we
+can only accept a +.hash+ file if the package is a released (e.g. uploaded
+by the maintainer) tarball. Otherwise, the automatically generated tarball
+may change over time, and thus its hashes may be different each time it is
+downloaded, making the +.hash+ file irrelevant for that tarball.

I wouldn't call it irrelevant, it is more that the hash won't match the tarball.

I've changed it to:

downloaded, causing a +.hash+ mismatch for that tarball.

And committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard