Skip to main content

verify_tofu

Function verify_tofu 

Source
pub fn verify_tofu(
    kh: &mut KnownHosts,
    host: &str,
    port: u16,
    fingerprint: &str,
    replace: bool,
) -> SshCliResult<bool>
Expand description

Verify TOFU fingerprint under exclusive flock (G-PAR-49 / G-TLS-10).

  • No entry: accept and record (TOFU).
  • Matching entry: accept.
  • Differing entry: refuse, unless replace is true.

Reloads from disk under the lock so concurrent multi-host first-connect sees peers’ writes before deciding.

§Errors

Returns an error if the host key changed and replacement was not allowed, or if persistence fails.