]> git.ipfire.org Git - thirdparty/bind9.git/commit
optimize key ID check when searching for matching keys
authorEvan Hunt <each@isc.org>
Fri, 14 Mar 2025 23:41:47 +0000 (16:41 -0700)
committerEvan Hunt <each@isc.org>
Thu, 20 Mar 2025 18:22:58 +0000 (18:22 +0000)
commit2e6107008dae09d32e3d34fb5423b3d78c4ff651
tree1f5c4a9ad8302f1b57b6dbbfd70cc938fdaec7c1
parent341b9626657b904f3746774677fdcca7f75da34b
optimize key ID check when searching for matching keys

when searching a DNSKEY or KEY rrset for the key that matches
a particular algorithm and ID, it's a waste of time to convert
every key into a dst_key object; it's faster to compute the key
ID by checksumming the region, and then only do the full key
conversion once we know we've found the correct key.

this optimization was already in use in the validator, but it's
been refactored for code clarity, and is now also used in query.c
and message.c.
lib/dns/dst_api.c
lib/dns/include/dst/dst.h
lib/dns/message.c
lib/dns/validator.c
lib/ns/query.c