commit f03511022641032a03dd9e12e3e5312f83ba4e52
parent 0784cb4d3a9e62927bc925db923b54fc54c8c9cb
Author: lash <dev@holbrook.no>
Date: Fri, 7 Nov 2025 04:30:47 +0000
Allow passphrase override in sign call
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/piknik/crypto.py b/piknik/crypto.py
@@ -50,9 +50,11 @@ class PGPSigner(Wrapper):
fn = '{}.asc'.format(msg.get('X-Piknik-Msg-Id'))
ms.add_header('Content-Disposition', 'attachment', filename=fn)
+ if passphrase == None:
+ passphrase = self.passphrase
self.set_from(msg, passphrase=passphrase)
v = msg.as_string()
- sig = self.gpg.sign(v, keyid=self.default_key, detach=True, passphrase=self.passphrase)
+ sig = self.gpg.sign(v, keyid=self.default_key, detach=True, passphrase=passphrase)
if sig.status != 'signature created':
raise SignError()
ms.set_payload(str(sig))