pub struct Claimed<I: Identity> { /* private fields */ }Expand description
A chain whose peer has claimed a static — §6.1’s stage 1, at 1 DH cumulative.
The claim is not proof. Drop is a silent reject.
S8 — #[must_use], see Intro. This is the stage S8 names
explicitly, the one parked across turns while a human is asked.
Implementations§
Source§impl<I: Identity> Claimed<I>
impl<I: Identity> Claimed<I>
Sourcepub fn claimed_static(&self) -> &PublicKeyOf<I>
pub fn claimed_static(&self) -> &PublicKeyOf<I>
The static the peer claims.
Named claimed_static, never remote_static, and the name is the
documentation: at this stage possession has not been proven. §6.1’s
ss in authenticate is what proves it.
Sourcepub async fn authenticate(self) -> Result<Proven<I>, AuthError>
pub async fn authenticate(self) -> Result<Proven<I>, AuthError>
§6.1’s stage 2 — +1 DH (ss), 2 cumulative.
Possession is proven here, and §17.1’s timestamp guard admits the
initiation here. On any error the chain is discarded, for the reason
given on Intro::read_identity.
Cancel-safe on the same terms as
Intro::read_identity: a dropped future
rejects the chain rather than orphaning it.
Defined only where the suite’s pattern has no pre-shared key; a
channel_psk! suite has
authenticate_with instead.
Sourcepub async fn authenticate_with(
self,
psk: PskOf<I>,
) -> Result<Proven<I>, AuthError>
pub async fn authenticate_with( self, psk: PskOf<I>, ) -> Result<Proven<I>, AuthError>
authenticate, naming the pre-shared key.
§This is the stage the PSK belongs at, and the reason is the cost
claimed_static is already in your hand
— one es, and nothing else, has been spent — so the key is
selected with the peer named. That ordering is the whole reason
the pattern is IKpsk1 and not a psk0 shape: its psk token sits
after msg1’s s, so a stranger you have no key for is rejected by
dropping this object, at 1 DH. Choosing inside the handshake
instead — hiss’s read_message_1_with lookup closure, which fires
at the psk token and therefore after the proving ss — would cost
2 (ruling 280).
This is also why the key is not held by the endpoint: an endpoint that already knew which PSK to use would have no use for the identity this stage exists to reveal.
§A wrong key is AuthError::HandshakeFailed
The same undetailed verdict a forged identity gets, and the same 2 DH. “You are not who you claim” and “you do not hold the pairing secret” are one answer to one question, and §18.1 gives an unauthenticated peer no oracle for telling them apart.
Cancel-safe on the same terms as
authenticate.
Trait Implementations§
Auto Trait Implementations§
impl<I> !RefUnwindSafe for Claimed<I>
impl<I> !Send for Claimed<I>
impl<I> !Sync for Claimed<I>
impl<I> !UnwindSafe for Claimed<I>
impl<I> Freeze for Claimed<I>
impl<I> Unpin for Claimed<I>
impl<I> UnsafeUnpin for Claimed<I>where
Shell<I>: UnsafeUnpin,
<<<I as Identity>::Suite as Channel>::Curve as Curve>::PublicKey: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<P> ProviderExt for P
impl<P> ProviderExt for P
Source§fn generate<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
fn generate<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
C.Source§fn generate_ephemeral<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
fn generate_ephemeral<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
C.