Skip to content

Commit

Permalink
5.2.1
Browse files Browse the repository at this point in the history
- Fix bug where TLSA records would not be checked in some cases
- Improved debug logging
  • Loading branch information
seanthegeek committed Jan 4, 2024
1 parent 424dfd1 commit 42ac9ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

5.2.1
-----

- Fix bug where TLSA records would not be checked in some cases
- Improved debug logging

5.2.0
-----

Expand Down
2 changes: 1 addition & 1 deletion checkdmarc/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
See the License for the specific language governing permissions and
limitations under the License."""

__version__ = "5.2.0"
__version__ = "5.2.1"

OS = platform.system()
OS_RELEASE = platform.release()
Expand Down
2 changes: 2 additions & 0 deletions checkdmarc/dnssec.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def get_dnskey(domain: str, nameservers: list[str] = None,
if domain in cache:
return cache[domain]

logging.debug(f"Checking for DNSKEY records at {domain}")
request = dns.message.make_query(domain,
dns.rdatatype.DNSKEY,
want_dnssec=True)
Expand Down Expand Up @@ -144,6 +145,7 @@ def get_tlsa_records(hostname: str, nameservers: list[str] = None,
if query_hostname in TLSA_CACHE:
return TLSA_CACHE[query_hostname]
tlsa_records = []
logging.debug(f"Checking for TLSA records at {query_hostname}")
request = dns.message.make_query(query_hostname,
dns.rdatatype.TLSA,
want_dnssec=True)
Expand Down
10 changes: 5 additions & 5 deletions checkdmarc/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ def get_mx_hosts(domain: str, skip_tls: bool = False,
nameservers=nameservers,
resolver=resolver,
timeout=timeout)
tlsa_records = get_tlsa_records(hostname,
nameservers=nameservers,
timeout=timeout)
if len(tlsa_records) > 0:
host["tlsa"] = tlsa_records
if len(host["addresses"]) == 0:
warnings.append(
f"{hostname} does not have any A or AAAA DNS records")
Expand Down Expand Up @@ -378,11 +383,6 @@ def get_mx_hosts(domain: str, skip_tls: bool = False,
"the A/AAAA DNS records for "
f"{hostname} do not resolve to "
f"{address}")
tlsa_records = get_tlsa_records(hostname,
nameservers=nameservers,
timeout=timeout)
if len(tlsa_records) > 0:
host["tlsa"] = tlsa_records
if not skip_tls and platform.system() == "Windows":
logging.warning("Testing TLS is not supported on Windows")
skip_tls = True
Expand Down

0 comments on commit 42ac9ba

Please sign in to comment.