Simplify error message for bad version (match what Google does)

This commit is contained in:
Scott Kitterman
2018-05-18 18:21:32 -04:00
parent bec6869c78
commit 92608e79c4
+2 -1
View File
@@ -386,8 +386,9 @@ def load_pk_from_dns(name, dnsfunc=get_txt):
raise KeyFormatError(e) raise KeyFormatError(e)
try: try:
if pub[b'v'] != b'DKIM1': if pub[b'v'] != b'DKIM1':
raise KeyFormatError("Unknown DKIM version in public key record: '{0}'".format(pub[b'v'])) raise KeyFormatError("bad version")
except KeyError as e: except KeyError as e:
# Version not required in key record: RFC 6376 3.6.1
pass pass
try: try:
if pub[b'k'] == b'ed25519': if pub[b'k'] == b'ed25519':