List for cgit developers and users
 help / color / mirror / Atom feed
From: konstantin at linuxfoundation.org (Konstantin Ryabitsev)
Subject: [RFC/PATCH 0/7] Snapshot signatures
Date: Mon, 2 Apr 2018 17:22:48 -0400	[thread overview]
Message-ID: <ae6f4689-2c50-97de-9f93-651ac3c67a5c@linuxfoundation.org> (raw)
In-Reply-To: <cover.1522510150.git.john@keeping.me.uk>

On 03/31/18 11:35, John Keeping wrote:
> Again, this isn't exactly what Konstantin asked for, but this approach
> is easier to implement and I think achieves the main goal of exposing
> signatures for snapshots.
> 
> The difference is that this approach has a notes ref for each archive
> format and the note simply contains the signature content; there is no
> additional metadata you just stick the signature in (for example)
> refs/notes/signatures/tar.gz against the relevant tag object.
> 
> This disadvantage of this is that we only support a single signature
> format, but I don't think that's a huge drawback as I expect any future
> format to be obviously different so that we can easily inspect the
> signature content to tell the difference.

Thanks for all this work, John! I have a few comments that I think would
be useful/relevant.

First, something to keep in mind: while "git archive --format tar" will
almost always generate the same byte-for-byte content between different
platforms/versions of git (it's considered a bug if it doesn't), the
same cannot be said about "--format tar.gz". An updated version of libz
can create different results. Similarly, someone can pass -9 in their
command for a higher compression ratio -- or even use something like
zopfli or pigz. This is even worse for xz or bz2, because they are not
natively available inside git-archive, so a person would use external
compression libraries and we can assume they would use different flags
from what cgit would use for the same purpose.

Therefore, I consider signatures for compressed versions near-useless,
because they will almost certainly no longer work some time after
they've been generated, while the goal is to provide tarball signatures
that can be used as far into the future as possible.

I like the idea of using refs/notes/signatures/[format] regardless what
I said above, but with this patch the (sig) links won't show up for
.tar.gz downloads, so I'd like to have a way to offer .tar sig downloads
for .tar.gz archives. :)

Secondly, the signature metadata *has* to include some way of telling
the end-user what prefix they should use with git-archive for this to be
useful outside of cgit. We don't need to parse this for cgit if we
provide snapshot-prefix info elsewhere, so it's just a musing out loud.
We can include this info inside the pgp signature comment, which is how
I planned to do it:

-----BEGIN PGP SIGNATURE-----
Comment: X-Git-Archive-Format tar
Comment: X-Git-Archive-Prefix linux-4.16/
Comment: X-Git-Archive-Version 2.16.2

[Actual sig data]

-----END PGP SIGNATURE-----

Using the above should allow anyone to recreate the tarball signature
from just the version of the repository without relying on any other info.

So, basically, what you have is just fine with me, as long as I can
offer a .tar signature for compressed archive versions.

Best,
-- 
Konstantin Ryabitsev
Director, IT Infrastructure Security
The Linux Foundation

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20180402/1de27890/attachment.asc>


      parent reply	other threads:[~2018-04-02 21:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31 15:35 john
2018-03-31 15:35 ` [RFC/PATCH 1/7] ui-refs: remove unnecessary sanity check john
2018-03-31 15:35 ` [RFC/PATCH 2/7] ui-shared: remove unused parameter john
2018-03-31 15:35 ` [RFC/PATCH 3/7] ui-shared: rename parameter to cgit_print_snapshot_links() john
2018-03-31 15:35 ` [RFC/PATCH 4/7] ui-shared: use the same snapshot logic as ui-refs john
2018-03-31 15:35 ` [RFC/PATCH 5/7] ui-shared: pass separator in to cgit_print_snapshot_links() john
2018-03-31 15:35 ` [RFC/PATCH 6/7] ui-refs: use shared function to print tag downloads john
2018-03-31 15:35 ` [RFC/PATCH 7/7] snapshot: support archive signatures john
2018-04-02 21:22 ` konstantin [this message]

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

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

  git send-email \
    --in-reply-to=ae6f4689-2c50-97de-9f93-651ac3c67a5c@linuxfoundation.org \
    --to=cgit@lists.zx2c4.com \
    /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.
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 NNTP newsgroup(s).