From 1413539c899bd2ecbc208f3ef70f99d2ecbb3352 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 23 Nov 2020 15:13:55 -0500 Subject: 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 --- b4/attest.py | 7 +++++-- 1 file 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=', ] -- cgit v1.2.3