]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolved: replace assert() with error return in DNSSEC verify functions
authorMilan Kyselica <mil.kyselica@gmail.com>
Thu, 9 Apr 2026 17:43:14 +0000 (19:43 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 10 Apr 2026 09:29:37 +0000 (10:29 +0100)
commitdd80e5a348bdb8185e040f66ede00fd4ffdee777
tree955febbb6fe0e4cfa4c02d608e58eda098d23d95
parenta65ebc3ff9a868bd447faa59789ee8e9ad8c534a
resolved: replace assert() with error return in DNSSEC verify functions

dnssec_rsa_verify_raw() asserts that RSA_size(key) matches the RRSIG
signature size, and dnssec_ecdsa_verify_raw() asserts that
EC_KEY_check_key() succeeds. Both conditions depend on parsed DNS
record content. Replace with proper error returns.

The actual crypto verify calls (EVP_PKEY_verify / ECDSA_do_verify)
handle mismatches fine on their own, so the asserts were also redundant.

While at it, fix the misleading "EC_POINT_bn2point failed" log message
that actually refers to an EC_KEY_set_public_key() failure.

Fixes: https://github.com/systemd/systemd/issues/41569
src/resolve/resolved-dns-dnssec.c