All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: signatures@kernel.org
Subject: [PATCH 2/2] Make header order deterministic
Date: Fri, 21 May 2021 13:39:33 -0400	[thread overview]
Message-ID: <307beab7b103b9859b941b9a41a6ef220dd78dd2.1621618750.git.konstantin@linuxfoundation.org> (raw)
In-Reply-To: <e6fbfe8cafa3da6e9a2791325a633d4bab0c7460.1621618750.git.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 17:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 17:39 [PATCH 1/2] Sign Message-Id header if present Konstantin Ryabitsev
2021-05-21 17:39 ` Konstantin Ryabitsev [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=307beab7b103b9859b941b9a41a6ef220dd78dd2.1621618750.git.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.