aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-23 15:13:55 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-23 15:13:55 -0500
commit1413539c899bd2ecbc208f3ef70f99d2ecbb3352 (patch)
tree2380b3d7e4fdabacee6dd6e1ae806823280749ef
parent02725469d7236e116662f5d863a9f34d5a3c616a (diff)
downloadb4-1413539c899bd2ecbc208f3ef70f99d2ecbb3352.tar.gz
Use correct identity in the i= field
We shouldn't be using the From: field, as it will not necessarily match the identity of the person submitting attestation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/attest.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/b4/attest.py b/b4/attest.py
index d7fbc27..e1a16f4 100644
--- a/b4/attest.py
+++ b/b4/attest.py
@@ -44,15 +44,18 @@ def in_header_attest(lmsg: b4.LoreMessage, mode: str = 'pgp', replace: bool = Fa
if mode == 'pgp':
usercfg = b4.get_user_config()
keyid = usercfg.get('signingkey')
+ identity = usercfg.get('email')
+ if not identity:
+ raise RuntimeError('Please set user.email to use this feature')
if not keyid:
raise RuntimeError('Please set user.signingKey to use this feature')
- logger.debug('Using i=%s, s=0x%s', lmsg.fromemail, keyid.rstrip('!'))
+ logger.debug('Using i=%s, s=0x%s', identity, keyid.rstrip('!'))
gpgargs = ['-b', '-u', f'{keyid}']
hparts = [
'm=pgp',
- f'i={lmsg.fromemail}',
+ f'i={identity}',
's=0x%s' % keyid.rstrip('!'),
'b=',
]