mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/tglx/remail.git
synced 2024-11-24 21:32:39 +01:00
remail/gpg: Use the lists private key for signing
Konstantin reported that outgoing mail from a mailing list is signed with the default private key found in the private keyring. That's caused by just handing boolen True into the 'sign' argument of gpg_encrypt() while the documentation clearly says: sign (defaults to None) Either the Boolean value True, or the fingerprint of a key which is used to sign the encrypted data. If True is specified, the default key is used for signing. When not specified, the data is not signed. Hand the list account fingerprint in if signing is enabled in the configuration. Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Reviewed-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
This commit is contained in:
parent
9b0ec00c8f
commit
fc918a9bef
1 changed files with 6 additions and 1 deletions
|
@ -89,9 +89,14 @@ class gpg_crypt(object):
|
||||||
def do_encrypt(self, payload, fingerprints):
|
def do_encrypt(self, payload, fingerprints):
|
||||||
''' Common encryption helper'''
|
''' Common encryption helper'''
|
||||||
|
|
||||||
|
if self.config.sign:
|
||||||
|
signit = self.account.fingerprint
|
||||||
|
else:
|
||||||
|
signit = None
|
||||||
|
|
||||||
enc = self.gpg.encrypt(payload, fingerprints, armor=self.config.armor,
|
enc = self.gpg.encrypt(payload, fingerprints, armor=self.config.armor,
|
||||||
always_trust=self.config.always_trust,
|
always_trust=self.config.always_trust,
|
||||||
sign=self.config.sign)
|
sign=signit)
|
||||||
if enc.ok:
|
if enc.ok:
|
||||||
return str(enc)
|
return str(enc)
|
||||||
raise RemailGPGException('Encryption fail: %s' % enc.status)
|
raise RemailGPGException('Encryption fail: %s' % enc.status)
|
||||||
|
|
Loading…
Reference in a new issue