diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-12-02 16:49:05 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-12-02 16:49:05 -0500 |
commit | 62c8d5fc878bd9a6fd2f5d0f9b92d413c32d658f (patch) | |
tree | ba9118bded8c80ef8f4aad2f66742b86b6d9ec32 | |
parent | 1bf166467251436c5b729844247ef3de099e43dd (diff) | |
download | b4-62c8d5fc878bd9a6fd2f5d0f9b92d413c32d658f.tar.gz |
Move the g= hash back into the XPH header
I didn't like it as a separate header, so move it back into the
X-Patch-Hashes header, but only add it if it's present.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/attest.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/b4/attest.py b/b4/attest.py index 8c98491..2b9ccab 100644 --- a/b4/attest.py +++ b/b4/attest.py @@ -36,6 +36,9 @@ def in_header_attest(lmsg: b4.LoreMessage, mode: str = 'pgp', replace: bool = Fa f'm={lmsg.attestation.mb}', f'p={lmsg.attestation.pb}', ] + if lmsg.git_patch_id: + hparts.append(f'g={lmsg.git_patch_id}') + hhname, hhval = b4.dkim_canonicalize_header(b4.HDR_PATCH_HASHES, '; '.join(hparts)) headers.append(f'{hhname}:{hhval}') @@ -76,8 +79,6 @@ def in_header_attest(lmsg: b4.LoreMessage, mode: str = 'pgp', replace: bool = Fa shdr = email.header.make_header([(shval.encode(), 'us-ascii')], maxlinelen=78) lmsg.msg[b4.HDR_PATCH_HASHES] = hhdr lmsg.msg[b4.HDR_PATCH_SIG] = shdr - if lmsg.git_patch_id: - lmsg.msg['X-Git-Patch-Id'] = lmsg.git_patch_id def header_splitter(longstr: str, limit: int = 77) -> str: |