pub struct EstablishedKeys {
pub i2r: SessionKeys,
pub r2i: SessionKeys,
pub attestation_challenge: SymmetricKey,
}rustcrypto only.Expand description
The three keys session establishment derives (§4.14.1, §4.14.2.7).
I2RKey || R2IKey || AttestationChallenge, in one KDF call.
Fields§
§i2r: SessionKeysInitiator to responder.
r2i: SessionKeysResponder to initiator.
attestation_challenge: SymmetricKey“SHALL only be used as a challenge during device attestation” (§6.2.3) — never as
an encryption key, which is why it is a distinct field and not a third SessionKeys.
Implementations§
Source§impl EstablishedKeys
impl EstablishedKeys
Sourcepub const fn sending(&self, role: Role) -> &SessionKeys
pub const fn sending(&self, role: Role) -> &SessionKeys
The keys this node encrypts with, given which end of establishment it was.
§4.14.2.7 names the two directions I2RKey and R2IKey, and which one a node uses
depends entirely on its role. Swapping them does not fail loudly — it produces a
message the peer cannot authenticate, which looks like a corrupt link rather than a
key mix-up. Naming the two directions is what keeps the question from being asked at
every call site.
Sourcepub const fn receiving(&self, role: Role) -> &SessionKeys
pub const fn receiving(&self, role: Role) -> &SessionKeys
The keys this node decrypts with — the other direction from Self::sending.
Sourcepub fn derive(shared_secret: &[u8], salt: &[u8]) -> Result<Self>
pub fn derive(shared_secret: &[u8], salt: &[u8]) -> Result<Self>
Derives all three from a shared secret and a salt, under "SessionKeys".
PASE passes an empty salt and Ke; CASE passes IPK || TranscriptHash and the
ECDH shared secret. Both call the same KDF with the same info string, which is why
this is one function rather than two that could drift apart.
Sourcepub fn derive_with_info(
shared_secret: &[u8],
salt: &[u8],
info: &[u8],
) -> Result<Self>
pub fn derive_with_info( shared_secret: &[u8], salt: &[u8], info: &[u8], ) -> Result<Self>
The same derivation under a different Info.
CASE resumption uses "SessionResumptionKeys" (§4.14.2.6.7) — the same three keys,
the same split, a different label, so that a resumed session’s keys can never
collide with a fresh one’s even if a secret and salt were somehow repeated.