bind9/tests/dns
Ondřej Surý 78a7f7da4f
Enforce strict RSA DNSKEY shape during DNSSEC validation
A resolver that validated DNSSEC accepted RSA DNSKEYs of any modulus
size up to OpenSSL's compile-time ceiling, and accepted any public
exponent the wire format could carry.  RSA verification cost grows
sharply with the modulus length, so an authoritative server could
publish an oversized DNSKEY to make each signature check on the
resolver many times more expensive than for a normally sized key.

The intended verify-time cap had no effect because the helper it called
returned the public-exponent bit length rather than the modulus bit
length, so the test was always satisfied.  Replace it with an honest
modulus-range check and a stricter exponent check that accepts only odd
exponents in the closed range [3, 2^32 + 1] (covering every Fermat
prime up to F5 and the odd intermediate values seen in deployed keys),
reject anything outside those bounds at every RSA key load path so an
invalid key never reaches the verifier, and keep the same checks at the
verifier as a backstop against future load paths.

(cherry picked from commit 8b2c490811)
2026-06-08 20:54:22 +02:00
..
comparekeys Remove TKEY Mode 2 (Diffie-Hellman) 2023-03-08 08:36:25 +01:00
testdata Move resconf_test.c to tests/dns and cleanup 2024-12-12 22:50:22 +00:00
testkeys Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
.gitignore Remove test.skr unit test file 2024-09-09 17:42:05 +00:00
acl_test.c Refactor dns_{acl,aclenv}_create to return void 2023-10-13 14:44:40 +02:00
badcache_test.c Improve the badcache cleaning by adding LRU and using RCU 2024-11-27 17:07:03 +00:00
db_test.c Support compilation with cmocka 2.0.0+ 2026-01-07 11:17:42 +01:00
dbdiff_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
dbiterator_test.c Implement dns_dbiterator_seek3 2025-12-11 13:53:25 +01:00
dbversion_test.c qpzone find() function could set foundname incorrectly 2025-03-17 09:27:09 +00:00
diff_test.c Import isc/list.h after cmocka to avoid redefinition errors 2025-07-29 14:07:05 +02:00
dispatch_test.c Switch UDP fetches to TCP on the first response with a wrong query id 2026-05-15 08:49:19 +02:00
dns64_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
dnstap_test.c Call tzset() after setenv("TZ", ...) in unit tests 2026-05-26 17:09:11 +02:00
dst_test.c Use clang-format-20 to update formatting 2025-06-25 13:32:08 +10:00
ede_test.c Support compilation with cmocka 2.0.0+ 2026-01-07 11:17:42 +01:00
geoip_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
Kdh.+002+18602.key Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
keytable_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
Krsa.+008+29238.key Check if RSASHA1 is supported by the OS 2022-08-09 16:22:19 +02:00
Makefile.am Move resconf_test.c to tests/dns and cleanup 2024-12-12 22:50:22 +00:00
master_test.c Fix formatting 2026-02-02 10:32:38 +01:00
mkraw.pl Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
name_test.c Use clang-format-20 to update formatting 2025-06-25 13:32:08 +10:00
nametree_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
nsec3_test.c Change max NSEC3 iterations in unit tests to 50 2023-12-05 14:58:58 +00:00
nsec3param_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
private_test.c Add "warn_unused_result" to attributes.h 2026-06-04 09:49:41 -07:00
qp_test.c Support compilation with cmocka 2.0.0+ 2026-01-07 11:17:42 +01:00
qpdb_test.c Make isc_mem_isovermem() probabilistic 2026-05-07 13:09:18 +02:00
qpmulti_test.c Fix dns_qpmulti_memusage() on empty dns_qpmulti_t instance 2025-09-17 14:01:44 +02:00
qpzone_test.c Fix formatting 2026-02-02 10:32:38 +01:00
rbt_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
rdata_test.c Test the ability to walk the iterators multiple times 2026-03-27 12:45:25 +00:00
rdataset_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
rdatasetstats_test.c Refactor isc_stats_create() and its downstream users to return void 2023-07-27 11:37:44 +02:00
resconf_test.c Move resconf_test.c to tests/dns and cleanup 2024-12-12 22:50:22 +00:00
resolver_test.c Support compilation with cmocka 2.0.0+ 2026-01-07 11:17:42 +01:00
rsa_test.c Enforce strict RSA DNSKEY shape during DNSSEC validation 2026-06-08 20:54:22 +02:00
sigs_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
skr_test.c Fix dnssec-keygen key collision checking for KEY rrtype keys 2025-10-22 12:55:41 +11:00
time_test.c Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
tsig_test.c Fix use-after-free in concurrent dns_tsigkey_delete() 2026-05-28 11:05:34 +02:00
update_test.c Call tzset() after setenv("TZ", ...) in unit tests 2026-05-26 17:09:11 +02:00
zonemgr_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
zt_test.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00