pub struct HashedHost {
pub salt: [u8; 20],
pub hash: [u8; 20],
pub fingerprint: String,
}Expand description
One HashKnownHosts yes entry (M19, FR-84).
OpenSSH replaces the plaintext host column with |1|salt|hash so a
casual reader of the known_hosts file cannot enumerate connected
hosts. The salt is 20 random bytes (matching HMAC-SHA1’s output
width); the hash is HMAC-SHA1(key=salt, data=hostname). Use
HashedHost::matches to test a candidate hostname against the
stored hash.
Multiple comma-separated |1|... tokens on one source line produce
one HashedHost per token, all sharing the same fingerprint.
Fields§
§salt: [u8; 20]Per-line random salt used as the HMAC-SHA1 key. Always 20 bytes.
hash: [u8; 20]HMAC-SHA1(salt, hostname) for the hostname this entry covers.
Always 20 bytes.
fingerprint: StringFingerprint of the host key, e.g. SHA256:uNiVztksCs....
Shared across every HashedHost derived from the same source
line.
Implementations§
Source§impl HashedHost
impl HashedHost
Trait Implementations§
Source§impl Clone for HashedHost
impl Clone for HashedHost
Source§fn clone(&self) -> HashedHost
fn clone(&self) -> HashedHost
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HashedHost
impl Debug for HashedHost
Source§impl PartialEq for HashedHost
impl PartialEq for HashedHost
Source§fn eq(&self, other: &HashedHost) -> bool
fn eq(&self, other: &HashedHost) -> bool
self and other values to be equal, and is used by ==.