aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/commands
diff options
context:
space:
mode:
authorJ08nY2017-08-02 20:59:26 +0200
committerJ08nY2017-08-02 20:59:26 +0200
commit7a4b76f64fc08d667ac48f432a726061998bd81f (patch)
tree8dee2b1a044c2a6ddfc84ba5a63ab6867d042273 /src/mailman_pgp/commands
parentffafcc3d57eba95095b64dbaad78bb6785266dc2 (diff)
downloadmailman-pgp-7a4b76f64fc08d667ac48f432a726061998bd81f.tar.gz
mailman-pgp-7a4b76f64fc08d667ac48f432a726061998bd81f.tar.zst
mailman-pgp-7a4b76f64fc08d667ac48f432a726061998bd81f.zip
Diffstat (limited to 'src/mailman_pgp/commands')
-rw-r--r--src/mailman_pgp/commands/eml_key.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mailman_pgp/commands/eml_key.py b/src/mailman_pgp/commands/eml_key.py
index e182451..b958b93 100644
--- a/src/mailman_pgp/commands/eml_key.py
+++ b/src/mailman_pgp/commands/eml_key.py
@@ -23,6 +23,7 @@ from mailman.interfaces.command import ContinueProcessing, IEmailCommand
from mailman.interfaces.pending import IPendings
from mailman.interfaces.subscriptions import ISubscriptionManager
from mailman.interfaces.usermanager import IUserManager
+from pgpy.constants import KeyFlags
from public import public
from zope.component import getUtility
from zope.interface import implementer
@@ -77,7 +78,7 @@ def _cmd_set(pgp_list, mlist, msg, msgdata, arguments, results):
file=results)
return ContinueProcessing.no
- if not key_usable(key):
+ if not key_usable(key, {KeyFlags.EncryptCommunications, KeyFlags.Sign}):
print('Need a key which can be used to encrypt communications.',
file=results)
return ContinueProcessing.no
@@ -228,7 +229,7 @@ def _cmd_change(pgp_list, mlist, msg, msgdata, arguments, results):
file=results)
return ContinueProcessing.no
- if not key_usable(key):
+ if not key_usable(key, {KeyFlags.EncryptCommunications, KeyFlags.Sign}):
print('Need a key which can be used to encrypt communications.',
file=results)
return ContinueProcessing.no