Skip to main content

enrollment_sas

Function enrollment_sas 

pub fn enrollment_sas(pairing_code: &str, ca_fingerprint_hex: &str) -> String
Expand description

The enrollment short-auth-string binding a one-time pairing code to the daemon CA fingerprint (no blind TOFU at bootstrap; threats A1/A7).

The daemon prints this beside the pairing code. A certless client recomputes it from the code the operator typed plus the CA fingerprint it received over the (server-authenticated, possibly MITM’d) enrollment channel, and the operator compares the two out of band. A MITM that substitutes its own CA yields a different fingerprint and therefore a mismatching SAS, so it cannot impersonate the daemon CA during the very first exchange. Same inputs on both ends must produce the same string, so this lives in the shared crate.

Returned as two groups of hex for easy visual comparison, e.g. A1B2-C3D4.