⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

FourWayHandshake

Struct FourWayHandshake 

Source
pub struct FourWayHandshake { /* private fields */ }
Expand description

WPA2 4-way handshake state machine (supplicant side)

Implementations§

Source§

impl FourWayHandshake

Source

pub fn new(pmk: [u8; 32], spa: MacAddress, aa: MacAddress) -> Self

Create a new handshake instance

Source

pub fn state(&self) -> WpaState

Get current handshake state

Source

pub fn ptk(&self) -> Option<&TemporalKey>

Get derived PTK (available after message 1 processing)

Source

pub fn process_message_1( &mut self, key_frame: &EapolKeyFrame, ) -> Option<Vec<u8>>

Process Message 1 from AP: receive ANonce, generate SNonce, derive PTK.

Returns Message 2 EAPOL-Key frame bytes to send back.

Source

pub fn process_message_3( &mut self, key_frame: &EapolKeyFrame, ) -> Option<Vec<u8>>

Process Message 3 from AP: verify MIC, install PTK.

Returns Message 4 EAPOL-Key frame bytes to send back.

Source

pub fn process_message_2(&mut self, key_frame: &EapolKeyFrame) -> bool

Process Message 2 (AP/authenticator side): verify MIC from supplicant.

Returns true if Message 2 is valid.

Source

pub fn process_message_4(&mut self, key_frame: &EapolKeyFrame) -> bool

Process Message 4 (AP/authenticator side): handshake complete.

Returns true if Message 4 is valid.

Source

pub fn verify_mic(kck: &[u8; 16], key_frame: &EapolKeyFrame) -> bool

Verify MIC on an EAPOL-Key frame using HMAC-SHA256(KCK, frame_with_zero_mic)

Auto Trait Implementations§

§

impl Freeze for FourWayHandshake

§

impl RefUnwindSafe for FourWayHandshake

§

impl Send for FourWayHandshake

§

impl Sync for FourWayHandshake

§

impl Unpin for FourWayHandshake

§

impl UnwindSafe for FourWayHandshake

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.