pub fn join_sae_handshake(
    sink: &mut SaeUpdateSink,
    first_frame: &AuthFrameRx,
    akm: Akm,
    ssid: Ssid,
    password: Vec<u8>,
    mac: MacAddr,
    peer_mac: MacAddr,
) -> Result<Box<dyn SaeHandshake>, Error> {
    let parsed_frame = frame::parse(first_frame)?;
    match parsed_frame {
        frame::ParseSuccess::Commit(commit) => {
            let mut handshake = new_sae_handshake(
                commit.group_id,
                akm,
                PweMethod::Loop,
                ssid,
                password,
                None,
                mac,
                peer_mac,
            )?;
            handshake.handle_commit(sink, &commit);
            Ok(handshake)
        }
        _ => bail!("Recieved incorrect first frame of SAE handshake"),
    }
}
/// Creates a new SAE handshake in response to a first message from a peer, using the FCG indiated
/// by the peer if possible. In a successful handshake, this will immediately push a Commit and
/// Confirm to the given update sink.
Creates a new SAE handshake in response to a first message from a peer, using the FCG indiated
by the peer if possible. In a successful handshake, this will immediately push a Commit and
Confirm to the given update sink.
Creates a new SAE handshake in response to a first message from a peer using the FCG indiated by the peer if possible . In a successful handshake this will immediately push a Commit and Confirm to the given update sink .
pub fn join_sae_handshake(
    sink: &mut SaeUpdateSink,
    first_frame: &AuthFrameRx,
    akm: Akm,
    ssid: Ssid,
    password: Vec<u8>,
    mac: MacAddr,
    peer_mac: MacAddr,
) -> Result<Box<dyn SaeHandshake>, Error> {
    let parsed_frame = frame::parse(first_frame)?;
    match parsed_frame {
        frame::ParseSuccess::Commit(commit) => {
            let mut handshake = new_sae_handshake(
                commit.group_id,
                akm,
                PweMethod::Loop,
                ssid,
                password,
                None,
                mac,
                peer_mac,
            )?;
            handshake.handle_commit(sink, &commit);
            Ok(handshake)
        }
        _ => bail!("Recieved incorrect first frame of SAE handshake"),
    }
}
pub fn join_sae_handshake ( sink : & mut SaeUpdateSink , first_frame : & AuthFrameRx , akm : Akm , ssid : Ssid , password : Vec < u8 > , mac : MacAddr , peer_mac : MacAddr , ) -> Result < Box < dyn SaeHandshake > , Error > { let parsed_frame = frame :: parse ( first_frame ) ? ; match parsed_frame { frame :: ParseSuccess :: Commit ( commit ) => { let mut handshake = new_sae_handshake ( commit . group_id , akm , PweMethod :: Loop , ssid , password , None , mac , peer_mac , ) ? ; handshake . handle_commit ( sink , & commit ) ; Ok ( handshake ) } _ => bail ! ( " " ) , } }
Creates a new SAE handshake in response to a first message from a peer, using the FCG indiated
by the peer if possible.
Creates a new SAE handshake in response to a first message from a peer using the FCG indiated by the peer if possible .
sink
&mut SaeUpdateSink
first_frame
&AuthFrameRx
akm
Akm
ssid
Ssid
password
Vec<u8>
mac
MacAddr
peer_mac
MacAddr
sink
&mut SaeUpdateSink
first_frame
&AuthFrameRx
akm
Akm
ssid
Ssid
password
Vec<u8>
mac
MacAddr
peer_mac
MacAddr