mirror of
https://github.com/freemkv/freemkv-keysources.git
synced 2026-10-07 18:13:11 +00:00
caf5d2a3b0e610399d5a28c9a67e9a86a01911f3
resolve_and_guard validates the keyserver's addresses and hardened_agent pins them, so a hostname cannot re-resolve to an internal address between the guard and the POST. The validation half has seven tests; the pin had none, and none of the existing tests makes a connection, so all 87 of them pass even with the resolver wiring removed entirely. That is a bad failure mode to leave uncovered, because a mis-wired resolver fails open: connections fall back to live DNS, the rebinding window reopens, and nothing looks wrong. Pin the agent at a loopback listener the test owns, then ask it for a host that cannot resolve (.invalid, reserved by RFC 2606). Only a consulted resolver can turn that name into a connection. Asserts the connection arrives, the round-trip completes, and the original host still travels in the request. Verified by removing the resolver wiring: this test fails on the timeout while the other 87 stay green.
Languages
Rust
100%