From: Bob Halley Date: Sun, 19 Feb 2017 21:54:22 +0000 (-0800) Subject: Handle _find_candidate_keys None return case. X-Git-Tag: v1.16.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b78ccf5a4b774afb2940e9cd78b2b972736885c6;p=thirdparty%2Fdnspython.git Handle _find_candidate_keys None return case. [Issue #236] --- diff --git a/dns/dnssec.py b/dns/dnssec.py index 6e9d4103..f316636a 100644 --- a/dns/dnssec.py +++ b/dns/dnssec.py @@ -294,10 +294,11 @@ def _validate_rrsig(rrset, rrsig, keys, origin=None, now=None): if isinstance(origin, string_types): origin = dns.name.from_text(origin, dns.name.root) - for candidate_key in _find_candidate_keys(keys, rrsig): - if not candidate_key: - raise ValidationFailure('unknown key') + candidate_keys = _find_candidate_keys(keys, rrsig) + if candidate_keys is None: + raise ValidationFailure('unknown key') + for candidate_key in candidate_keys: # For convenience, allow the rrset to be specified as a (name, # rdataset) tuple as well as a proper rrset if isinstance(rrset, tuple):