pub struct CaseOutcome {
pub keys: EstablishedKeys,
pub peer: VerifiedIdentity,
pub peer_session_id: SessionId,
pub peer_session_params: Option<SessionParams>,
pub resumption: ResumptionState,
}rustcrypto only.Expand description
Everything a completed CASE hands back.
Fields§
§keys: EstablishedKeysThe three session keys.
peer: VerifiedIdentityThe peer’s authenticated operational identity.
peer_session_id: SessionIdThe session id the peer will listen on — what this node puts in outgoing messages.
peer_session_params: Option<SessionParams>The MRP parameters the peer announced, if it announced any.
resumption: ResumptionStateState for a later resumption, which the caller may keep or drop.
Implementations§
Source§impl CaseOutcome
impl CaseOutcome
Sourcepub fn into_session(
&self,
local_session_id: SessionId,
fabric: &Fabric,
randomness: u32,
now: Instant,
) -> SecureSession
pub fn into_session( &self, local_session_id: SessionId, fabric: &Fabric, randomness: u32, now: Instant, ) -> SecureSession
Builds the operational session this handshake produced.
Every identity a CASE session needs comes from exactly two places — this outcome and
the fabric the handshake ran on — so taking both is the only way to be sure none is
left at its default. Assembling a SecureSession
field by field is still possible and is still wrong more often than it is right.
The field that makes this more than convenience is local_node_id. §4.9.2 builds the
AEAD nonce from “the Security Flags, the Message Counter, and the Source Node ID of
that message”, and for a CASE session the source node id is the sender’s operational
node id — which never appears in the header, because both ends are supposed to know
it from the session. A session left at
NodeId::UNSPECIFIED therefore encrypts every
message with a nonce the peer will not reconstruct, and the peer discards them
as unauthenticated. Nothing fails locally: this node sends, MRP retransmits into
silence, and the exchange is abandoned with no error at either end that names the
cause.
randomness seeds the outgoing message counter (§4.6.2, which randomises it “on session
establishment”) and now timestamps the
session, exactly as SecureSession::new takes them.
Sourcepub fn into_initiator_session(
&self,
local_session_id: SessionId,
fabric: &Fabric,
randomness: u32,
now: Instant,
) -> SecureSession
pub fn into_initiator_session( &self, local_session_id: SessionId, fabric: &Fabric, randomness: u32, now: Instant, ) -> SecureSession
The same, for the node that initiated the handshake.
The only difference is the role, and the role decides which of the two directional
keys this node encrypts with (§4.14.1) — so getting it wrong is the same silent
failure as getting local_node_id wrong.