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 6FC0CC4707C for ; Fri, 21 May 2021 18:48:13 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 4A234601FD; Fri, 21 May 2021 18:48:13 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 10823613DF for ; Fri, 21 May 2021 18:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621622893; bh=+z3VF3gPXKcFBVPa5eoQ0hnkdw3zu1D9P+jiP8bkuS4=; h=From:List-Id:To:Subject:Date:In-Reply-To:References:From; b=CLFdlKodoQ5kcCjVRm/+vk0nXslz2bBbwqJwhvFAo3GcHCRoBV/CFT5lcNTArDrod 87PNfzI9slCy2BjeieCzXZzFgUiuTMW3QMewNimHd8Q9N3fxylHtsIPma+oFipqDL4 szPq5AavTL8JGVt4ALhaQJZjUT7IIAtaMDMZLM3I= From: Konstantin Ryabitsev List-Id: To: signatures@kernel.org Subject: [PATCH 2/3] Make header order deterministic Date: Fri, 21 May 2021 14:48:10 -0400 Message-Id: <20210521184811.617875-2-konstantin@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210521184811.617875-1-konstantin@linuxfoundation.org> References: <20210521184811.617875-1-konstantin@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1016; h=from:subject; bh=+z3VF3gPXKcFBVPa5eoQ0hnkdw3zu1D9P+jiP8bkuS4=; b=owGbwMvMwCG27YjM47CUmTmMp9WSGBJWMGSzlE6aHHTllPVSwY3/bnvJ3VX8oFP8ubjjvumSqvfa LzxfdJSyMIhxMMiKKbKU7YvdFFT40EMuvccUZg4rE8gQBi5OAZhIXTnDL+YUR4ck/lvMM2tyVr8sSf ivMsFoVYL/d3+Ze8evBERJfWL4H1W/XzRLM8Ncu3fGN5YrAeJV56bOll255/M+obl1E54LsgEA 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