Upstream issue #62 also handled KEYREVOKED status. Changes reflect this.

testing/mmn/mktime_takes_localtime_not_gmtime
Tom Galloway 2013-06-28 13:20:39 +01:00
parent ca1acaf7e6
commit c10df26d0b
1 changed files with 10 additions and 1 deletions

View File

@ -782,6 +782,10 @@ class Sign(object):
self.what, self.timestamp, self.fingerprint) = value.split() self.what, self.timestamp, self.fingerprint) = value.split()
elif key == "KEYEXPIRED": elif key == "KEYEXPIRED":
self.status = "skipped signing key, key expired" self.status = "skipped signing key, key expired"
if (value is not None) and (len(value) > 0):
self.status += " on {}".format(str(value))
elif key == "KEYREVOKED":
self.status = "skipped signing key, key revoked"
if (value is not None) and (len(value) > 0): if (value is not None) and (len(value) > 0):
self.status += " on {}".format(str(value)) self.status += " on {}".format(str(value))
elif key == "NODATA": elif key == "NODATA":
@ -936,6 +940,9 @@ class ImportResult(object):
elif key == "KEYEXPIRED": elif key == "KEYEXPIRED":
self.results.append({'fingerprint': None, self.results.append({'fingerprint': None,
'problem': '0', 'text': 'Key expired'}) 'problem': '0', 'text': 'Key expired'})
elif key == "KEYREVOKED":
self.results.append({'fingerprint': None,
'problem': '0', 'text': 'Key revoked'})
elif key == "SIGEXPIRED": elif key == "SIGEXPIRED":
self.results.append({'fingerprint': None, self.results.append({'fingerprint': None,
'problem': '0', 'text': 'Signature expired'}) 'problem': '0', 'text': 'Signature expired'})
@ -1070,7 +1077,7 @@ class Verify(object):
self.valid = False self.valid = False
self.key_id = value self.key_id = value
self.status = 'no public key' self.status = 'no public key'
elif key in ("KEYEXPIRED", "SIGEXPIRED"): elif key in ("KEYEXPIRED", "SIGEXPIRED", "KEYREVOKED"):
# these are useless in verify, since they are spit out for any # these are useless in verify, since they are spit out for any
# pub/subkeys on the key, not just the one doing the signing. # pub/subkeys on the key, not just the one doing the signing.
# if we want to check for signatures with expired key, # if we want to check for signatures with expired key,
@ -1138,6 +1145,8 @@ class Crypt(Verify):
self.status = 'invalid recipient' self.status = 'invalid recipient'
elif key == "KEYEXPIRED": elif key == "KEYEXPIRED":
self.status = 'key expired' self.status = 'key expired'
elif key == "KEYREVOKED":
self.status = 'key revoked'
elif key == "SIG_CREATED": elif key == "SIG_CREATED":
self.status = 'sig created' self.status = 'sig created'
elif key == "SIGEXPIRED": elif key == "SIGEXPIRED":