diff options
Diffstat (limited to 'src/mailman_pgp/commands/eml_key.py')
| -rw-r--r-- | src/mailman_pgp/commands/eml_key.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mailman_pgp/commands/eml_key.py b/src/mailman_pgp/commands/eml_key.py index e38e96d..9a64fc7 100644 --- a/src/mailman_pgp/commands/eml_key.py +++ b/src/mailman_pgp/commands/eml_key.py @@ -290,34 +290,42 @@ def _cmd_revoke(pgp_list, mlist, msg, msgdata, arguments, results): key_copy = copy.copy(key) revocs = list(wrapped.revocs()) + matches = 0 for revoc in revocs: + old_matches = matches try: verified = key_copy.verify(key_copy, revoc) if verified: key_copy |= revoc + matches += 1 continue except PGPError: pass for subkey in key_copy.subkeys.values(): try: - verified = subkey.verify(subkey, revoc) + verified = key_copy.verify(subkey, revoc) if verified: subkey |= revoc + matches += 1 + break except PGPError: pass # No match? - print('Revocation found for not-found key.', file=results) + if matches == old_matches: + print('Revocation found for not-found key.', file=results) if not key_usable(key_copy, {KeyFlags.EncryptCommunications, KeyFlags.Sign}): - pass # Start reset process. + # TODO: finish this. + print('Key needs to be reset.', file=results) else: # Just update key. - with transaction(): - pgp_address.key = key_copy - print('Key succesfully updated.', file=results) + if matches > 0: + with transaction(): + pgp_address.key = key_copy + print('Key succesfully updated.', file=results) return ContinueProcessing.yes |
