From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D98A6C4707C for ; Fri, 21 May 2021 17:39:34 +0000 (UTC) Received: by mail.kernel.org (Postfix) id C060461244; Fri, 21 May 2021 17:39:34 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8512961168 for ; Fri, 21 May 2021 17:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621618774; bh=+z3VF3gPXKcFBVPa5eoQ0hnkdw3zu1D9P+jiP8bkuS4=; h=From:List-Id:To:Subject:Date:In-Reply-To:References:From; b=LVxt40YYqL5SPRFSvvtHY4JrRJCxqMTQ8q9fWDQwHbydWoDLwRvK5CdXPtRvmlPDO +SSGFzmlngEuse5r1Rm6d/42hBFJtILHNS3SwljFPGF/85X1fxQtAJW9iI0/i0e5v1 ot0cGVl1Q4TeA44omRxtq4A5Y1TQdaZh2P4+Op2U= From: Konstantin Ryabitsev List-Id: To: signatures@kernel.org Subject: [PATCH 2/2] Make header order deterministic Date: Fri, 21 May 2021 13:39:33 -0400 Message-Id: <307beab7b103b9859b941b9a41a6ef220dd78dd2.1621618750.git.konstantin@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1016; h=from:subject:message-id; bh=+z3VF3gPXKcFBVPa5eoQ0hnkdw3zu1D9P+jiP8bkuS4=; b=owGbwMvMwCG27YjM47CUmTmMp9WSGBKWfwj98fcNe9Qn19yVVxSrea4cTDGUnWbQmXb39vHsBCGF 6yu3dZSyMIhxMMiKKbKU7YvdFFT40EMuvccUZg4rE8gQBi5OAZjI2YWMDK/KuheETehfHLTm09yaT3 LG34v3nktxe7RATLzjSzr7rRcM/wy3+KxfyMEovbD48+eqJ1o5NY37C3n0nnCZt0/3WXPxAzcA X-Developer-Key: i=konstantin@linuxfoundation.org; a=openpgp; fpr=DE0E66E32F1FDD0902666B96E63EDCA9329DD07E Content-Transfer-Encoding: 8bit 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 --- 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