Skip to main content

load_authentication

Function load_authentication 

Source
pub fn load_authentication(
    config: &GossipConfig,
) -> Result<(Option<GossipSigner>, GossipVerifier), GossipCryptoError>
Expand description

Load the authentication material implied by config: the outbound signer (when an identity_key is configured) and the always-present inbound verifier for the configured AuthMode (F09).

This is the single policy-loading path shared by GossipNode::start and hoike check, so both decide the effective policy identically. Failures are fatal configuration errors, never a fallback to unauthenticated operation:

  • a nonempty legacy peer_keys list (cannot authorize node identities);
  • required mode without a local identity_key;
  • unreadable or invalid key material;
  • a peer_identities mapping for the local node name that disagrees with the local identity_key (ambiguous attribution).

Disabled gossip never calls this, so a disabled section needs no key material. In permissive mode a node without an identity_key still gets a verifier: unsigned input is accepted, but signed input is held to the provisioned identities — an empty trusted set rejects every signature.