unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Adam Majer <amajer@suse.de>, David Bremner <david@tethera.net>,
	Carl Worth <cworth@cworth.org>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH] build: sign tarball instead of sha256sum
Date: Fri, 15 Mar 2019 12:48:21 -0400	[thread overview]
Message-ID: <87d0msw0bu.fsf@fifthhorseman.net> (raw)
In-Reply-To: <8d74a186-ab58-ea1b-1c42-4112f617b1cb@suse.de>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Fri 2019-03-15 15:30:56 +0100, Adam Majer wrote:
> The .spec file has (I added some comments here)
>
> Name:           nodejs10
> Version:        10.15.3
> Source:         https://nodejs.org/dist/v%{version}/node-v%{version}.tar.xz
> Source1:        https://nodejs.org/dist/v%{version}/SHASUMS256.txt
> Source2:        https://nodejs.org/dist/v%{version}/SHASUMS256.txt.sig
> Source3:        nodejs.keyring

interesting -- i note that the thing signed here is actually a checksum
file, and not the tarball itself.  Please use this technique for notmuch
too! does this mean that you don't need the detached tarball signature?
:)

> The .sig is verified vs. nodejs.keyring on checkin. And for build, the 
> %prep phase in start of the build has,
>
> # this checks the checksum
> echo "`grep node-v%{version}.tar.xz %{S:1} | head -n1 | cut -c1-64`  %{S:0}" | sha256sum -c

(i think this was line-wrapped; i unwrapped it and i hope i got the
whitespace right)

this is interesting!  I'd want to tighten up the grep a bit, and drop
the head -n1 (seems like it means "cross your fingers and hope we got
the right one", which is not great for signature verification), and it's
not clear that you need to rebuild the line itself.

If you've already verified SHASUMS256.txt.sig, Why not just:

   grep -E '^[0-9a-f]{64} [ *]node-v%{version}\.tar\.xz$' %{S:1} | sha256sum -c

(this still doesn't properly escape regex metacharacters like . in
%{version}, but it's a much tighter match than the earlier line.

> # this unpacks the tarball Source0 and changes to directory
> # node-v%{version}
> %setup -q -n node-v%{version}
>
> The build would break if directory is different name.

i'm assuming that this is done starting from an empty directory by
default -- otherwise it could misbehave if there was cruft leftover from
some other unpacking.

> The build would break if checksum is wrong, but that has explicit
> verification. And build would not even be attempted if *.sig wasn't
> signed by a key in the *.keyring file.

nice, this is very good.  it looks like OBS is checking:

 * cryptographic signature over the tarball name (which includes package
   and version)
 * that the tarball contains a directory named with the package and version

that's a robust check, and it looks good.

> Not only that, because the SourceX is a URL, distributions like 
> Tumbleweed that accept lots of submissions, have automated bot that will 
> download these files and compare them to what was submitted. If these 
> differ, it will reject. This actually caught NodeJS project adding ARM 
> binaries to their release after release and re-issuing the checksums. 
> Not malicious, just annoying (for me :)

It's great that you caught this!  Does tumbleweed have a "wall of shame"
for "re-released" software?  I'd love to know the history of what it has
caught.  I'm sure most are "legitimate" mistakes.  But hiding in the
noise could be some real malfeasance (which is why it'd be good to get
rid of the noise).

At this point, we're pretty far afield from notmuch -- if others are
annoyed, i'm happy to take the discussion to private mail or some other
mailing list if folks would prefer it.

    --dkg
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQTJDm02IAobkioVCed2GBllKa5f+AUCXIvXVQAKCRB2GBllKa5f
+IezAP9a6K76MbP8UQBxeLk7UTo/OVV6GZyNCa5nSL7Lm88ziQEAhr6wydCe9LBJ
wrBYRNbBLqato1XRfjBb+m8Uzz7vtwY=
=eBIA
-----END PGP SIGNATURE-----

  reply	other threads:[~2019-03-15 16:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 10:48 Release signatures Adam Majer
2019-02-10 13:51 ` David Bremner
2019-02-11 23:37   ` Carl Worth
2019-02-13  2:17     ` [PATCH] build: sign tarball instead of sha256sum David Bremner
2019-03-12 10:55       ` David Bremner
2019-03-14 22:51         ` Daniel Kahn Gillmor
2019-03-15  1:49           ` David Bremner
2019-03-15  8:48             ` Daniel Kahn Gillmor
2019-03-15  1:53           ` Adam Majer
2019-03-15  8:58             ` Daniel Kahn Gillmor
2019-03-15 10:49               ` David Bremner
2019-03-15 13:47                 ` Daniel Kahn Gillmor
2019-03-15 13:56                   ` David Bremner
2019-03-15 14:50                     ` Daniel Kahn Gillmor
2019-03-15 14:30                   ` Adam Majer
2019-03-15 16:48                     ` Daniel Kahn Gillmor [this message]
2019-03-23 11:21                   ` [PATCH] build: distribute signed sha256sums Daniel Kahn Gillmor
2019-03-23 12:35                     ` [PATCH v2 1/3] build: ensure that SHA256_FILE is built Daniel Kahn Gillmor
2019-03-23 12:35                       ` [PATCH v2 2/3] build: distribute signed sha256sums Daniel Kahn Gillmor
2019-03-23 12:35                       ` [PATCH v2 3/3] build: Rename GPG_FILE to DETACHED_SIG_FILE Daniel Kahn Gillmor
2019-03-27 21:02                       ` [PATCH v2 1/3] build: ensure that SHA256_FILE is built David Bremner
2019-03-15 11:35               ` [PATCH] build: sign tarball instead of sha256sum Adam Majer
2019-03-15 13:37                 ` Daniel Kahn Gillmor
2019-03-15 14:18                   ` Adam Majer
2019-03-15 13:50                 ` David Bremner
2019-03-15 15:35                   ` Daniel Kahn Gillmor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0msw0bu.fsf@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=amajer@suse.de \
    --cc=cworth@cworth.org \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).