pub fn verify_hello(
hello: &PeerHello,
from: HandshakeRole,
exporter: &[u8; 32],
local_device: Uuid,
trust: &PinnedTrust,
versions: &dyn DirectoryVersions,
) -> Result<(Uuid, String), PeeringError>Expand description
The application-layer hybrid check — the whole security of the channel. Run before any payload byte against the locally-pinned trust. In order:
- Version window. The pair speaks the highest common version; disjoint windows abort
with
PeeringError::VersionDisjointbefore any identity check. - Directory chains to our IK. The pinned directory must verify under our pinned User IK; a directory signed by a foreign IK is rejected outright.
- Anti-rollback. The pinned directory must not be older than the highest this device has verified, and the peer must not present a version older than the one we pin.
- Not ourselves. A hello claiming
local_device, our own id, is refused withPeeringError::SelfPeer: a device never peers with itself. - Enrolled + not revoked. The claimed
device_idmust be present and un-revoked. - Hybrid proof. The peer’s published device key must verify the hybrid signature over the
exact exporter material we derived, bound to
from: the role the peer holds on this channel, the opposite of ours. That binds the hybrid identity to this TLS session and to its far end, so a hello reflected back at its sender fails.
Returns the verified device id and the negotiated protocol version.