commit 815575036d8b7ee048774b18cda35756462082a5
parent ebc386e498835d0bc3aaae1ed210623abdcda737
Author: lash <dev@holbrook.no>
Date: Sun, 24 Aug 2025 22:24:20 +0100
Cancel message signature if not success
Diffstat:
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/piknik/crypto.py b/piknik/crypto.py
@@ -10,6 +10,7 @@ import gnupg
# local imports
from piknik.error import VerifyError
from piknik.error import UnknownIdentityError
+from piknik.error import SignError
from piknik.wrap import Wrapper
logg = logging.getLogger(__name__)
@@ -52,6 +53,8 @@ class PGPSigner(Wrapper):
self.set_from(msg, passphrase=passphrase)
v = msg.as_string()
sig = self.gpg.sign(v, keyid=self.default_key, detach=True, passphrase=self.passphrase)
+ if sig.status != 'signature created':
+ raise SignError()
ms.set_payload(str(sig))
m.attach(msg)
diff --git a/piknik/error.py b/piknik/error.py
@@ -12,3 +12,7 @@ class UnknownIdentityError(Exception):
class VerifyError(Exception):
pass
+
+
+class SignError(Exception):
+ pass
diff --git a/setup.cfg b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = piknik
-version = 0.3.18rc3
+version = 0.3.18rc4
description = CLI issue tracker
author = Louis Holbrook
author_email = dev@holbrook.no