aboutsummaryrefslogtreecommitdiff
path: root/b4/attest.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-12-02 12:23:26 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-12-02 12:23:26 -0500
commit626959e89b38fc95c54fad58baac131755cce04f (patch)
tree7844762492ea7c7b453a65d92b051b3d253e4695 /b4/attest.py
parent1c4a327d1d9e5de475073f76a53e5257d534e8fe (diff)
downloadb4-626959e89b38fc95c54fad58baac131755cce04f.tar.gz
Don't give up on attestation if there's no index
Patches created with quilt will have no indexes, so git patch-id is refusing to generate a hash for them (somehow, though why?). At any rate, don't give up on attesting these patches even without the git's patch-id. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/attest.py')
-rw-r--r--b4/attest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/b4/attest.py b/b4/attest.py
index 672b0e1..8c98491 100644
--- a/b4/attest.py
+++ b/b4/attest.py
@@ -32,7 +32,6 @@ def in_header_attest(lmsg: b4.LoreMessage, mode: str = 'pgp', replace: bool = Fa
hparts = [
'v=1',
'h=sha256',
- f'g={lmsg.git_patch_id}',
f'i={lmsg.attestation.ib}',
f'm={lmsg.attestation.mb}',
f'p={lmsg.attestation.pb}',
@@ -77,6 +76,8 @@ 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: