signatures.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: signatures@kernel.org
Subject: [PATCH 2/3] Make header order deterministic
Date: Fri, 21 May 2021 14:48:10 -0400	[thread overview]
Message-ID: <20210521184811.617875-2-konstantin@linuxfoundation.org> (raw)
In-Reply-To: <20210521184811.617875-1-konstantin@linuxfoundation.org>

I know that it doesn't matter, but the OCD part of me likes seeing the
h= value in a deterministic order.

Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
---
 patatt/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/patatt/__init__.py b/patatt/__init__.py
index 76028ae..a80f63a 100644
--- a/patatt/__init__.py
+++ b/patatt/__init__.py
@@ -149,8 +149,8 @@ class DevsigHeader:
                 raise SigningError('The following required headers not present: %s'
                                    % (b', '.join(reqset.difference(allhdrs)).decode()))
             # Add optional headers that are actually present
-            optpresent = allhdrs.intersection(optset)
-            signlist = list(reqset.union(optpresent))
+            optpresent = list(allhdrs.intersection(optset))
+            signlist = REQ_HDRS + sorted(optpresent)
             self.hdata['h'] = b':'.join(signlist)
 
         elif mode == 'validate':
-- 
2.31.1


  reply	other threads:[~2021-05-21 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 18:48 [PATCH 1/3] Sign Message-Id header if present Konstantin Ryabitsev
2021-05-21 18:48 ` Konstantin Ryabitsev [this message]
2021-05-21 18:48 ` [PATCH 3/3] Release as 0.4.0 Konstantin Ryabitsev

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=20210521184811.617875-2-konstantin@linuxfoundation.org \
    --to=konstantin@linuxfoundation.org \
    --cc=signatures@kernel.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.
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).