Detect incorrect version in DKIM public key record (LP: #1763815)
This commit is contained in:
@@ -5,6 +5,7 @@ Unreleased Version 0.8.0
|
|||||||
dependencies for dkimpy (LP: #1227526)
|
dependencies for dkimpy (LP: #1227526)
|
||||||
- Fix typo in dknewky(1) for k= tag (Thanks to Andreas Schulze for
|
- Fix typo in dknewky(1) for k= tag (Thanks to Andreas Schulze for
|
||||||
reporting)
|
reporting)
|
||||||
|
- Detect incorrect version in DKIM public key record (LP: #1763815)
|
||||||
- Indicate that ed25519-sha256 is no longer experimental
|
- Indicate that ed25519-sha256 is no longer experimental
|
||||||
|
|
||||||
2018-02-17 Version 0.7.1
|
2018-02-17 Version 0.7.1
|
||||||
|
|||||||
@@ -384,6 +384,11 @@ def load_pk_from_dns(name, dnsfunc=get_txt):
|
|||||||
pub = parse_tag_value(s)
|
pub = parse_tag_value(s)
|
||||||
except InvalidTagValueList as e:
|
except InvalidTagValueList as e:
|
||||||
raise KeyFormatError(e)
|
raise KeyFormatError(e)
|
||||||
|
try:
|
||||||
|
if pub[b'v'] != b'DKIM1':
|
||||||
|
raise KeyFormatError("Unknown DKIM version in public key record: '{0}'".format(pub[b'v']))
|
||||||
|
except KeyError as e:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
if pub[b'k'] == b'ed25519':
|
if pub[b'k'] == b'ed25519':
|
||||||
pk = nacl.signing.VerifyKey(pub[b'p'], encoder=nacl.encoding.Base64Encoder)
|
pk = nacl.signing.VerifyKey(pub[b'p'], encoder=nacl.encoding.Base64Encoder)
|
||||||
|
|||||||
Reference in New Issue
Block a user