Missing public key is a KeyFormatError

This commit is contained in:
Stuart D. Gathman committed 2011-10-25 13:12:02 -04:00
1 parent 47a5d949ea
commit e9e4775c3c
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -520,6 +520,8 @@ class DKIM(object):
raise KeyFormatError(e)
try:
pk = parse_public_key(base64.b64decode(pub[b'p']))
except KeyError:
raise KeyFormatError("incomplete public key: %s" % s)
except (TypeError,UnparsableKeyError) as e:
raise KeyFormatError("could not parse public key (%s): %s" % (pub[b'p'],e))
include_headers = [x.lower() for x in re.split(br"\s*:\s*", sig[b'h'])]