domainaware / checkdmarc

A parser for SPF and DMARC DNS records
https://domainaware.github.io/checkdmarc
Apache License 2.0
244 stars 76 forks source link

Issue #136 - Bugfix test_dnssec method cache #137

Closed mohammad-latacora closed 1 month ago

mohammad-latacora commented 3 months ago

https://github.com/domainaware/checkdmarc/blob/3d3da6edee43f2b03c28d0747c95f202be25fd92/checkdmarc/dnssec.py#L109

This line is attempting to access a cache within a cache. This throws an unhashable type: 'ExpiringDict' error.

This PR proposes replacing that with the following

  if domain in cache:
      return cache[domain]

Which is identical to what is used by the get_dnskey method on line 57

aharpour commented 3 months ago

I ran into the same issue and it fixed it for me. @mohammad-latacora Thank you!