[PATCH 2/3] Make header order deterministic
Konstantin Ryabitsev <[email protected]> Fri, 21 May 2021 14:48:10 -0400
| Newsgroups | org.kernel.lore.signatures |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- 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