Add support for EAI addresses in domains and selectors (John Levine)

This commit is contained in:
Scott Kitterman
2018-10-29 21:55:12 -04:00
parent 3a2e5fef61
commit 5349a9f813
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -1,4 +1,5 @@
UNRELEASED Version 0.9.0
- Add support for EAI addresses in domains and selectors (John Levine)
- Add type Hinting for sign and verify functions (LP: #1782596)
(Thomas Ward)
- PEP8 Blank Lines Style Issues (LP: #1782596)
+2 -2
View File
@@ -53,7 +53,7 @@ def get_txt_Milter_dns(name):
if name.endswith('.'):
name = name[:-1]
sess = Session()
a = sess.dns(name,'TXT')
a = sess.dns(name.encode('idna'),'TXT')
if a: return b''.join(a[0])
return None
@@ -79,7 +79,7 @@ def get_txt(name):
"""
# pydns needs Unicode, but DKIM's d= is ASCII (already punycoded).
try:
unicode_name = name.decode('ascii')
unicode_name = name.decode('UTF-8')
except UnicodeDecodeError:
return None
txt = _get_txt(unicode_name)