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

HandshakeEngine

Struct HandshakeEngine 

Source
pub struct HandshakeEngine {
    pub state: HandshakeState,
    pub cipher_suite: Option<CipherSuite>,
    pub handshake_secret: Option<[u8; 32]>,
    pub client_hs_traffic_secret: Option<[u8; 32]>,
    pub server_hs_traffic_secret: Option<[u8; 32]>,
    pub client_app_traffic_secret: Option<[u8; 32]>,
    pub server_app_traffic_secret: Option<[u8; 32]>,
    pub peer_certificate: Option<Vec<u8>>,
    /* private fields */
}
Expand description

Handshake engine managing state transitions and transcript

Fields§

§state: HandshakeState§cipher_suite: Option<CipherSuite>

Negotiated cipher suite

§handshake_secret: Option<[u8; 32]>

Derived handshake secrets

§client_hs_traffic_secret: Option<[u8; 32]>

Client handshake traffic secret

§server_hs_traffic_secret: Option<[u8; 32]>

Server handshake traffic secret

§client_app_traffic_secret: Option<[u8; 32]>

Client application traffic secret

§server_app_traffic_secret: Option<[u8; 32]>

Server application traffic secret

§peer_certificate: Option<Vec<u8>>

Peer certificate (DER bytes)

Implementations§

Source§

impl HandshakeEngine

Source

pub fn new() -> Self

Create a new handshake engine with generated ephemeral keys

Source

pub fn build_client_hello(&mut self, random: [u8; 32]) -> Option<Vec<u8>>

Build and return the ClientHello message, advancing state

Source

pub fn process_server_hello(&mut self, data: &[u8]) -> Option<()>

Process a received ServerHello message

Source

pub fn process_encrypted_extensions(&mut self, data: &[u8]) -> Option<()>

Process EncryptedExtensions message

Source

pub fn process_certificate(&mut self, data: &[u8]) -> Option<()>

Process Certificate message

Source

pub fn process_certificate_verify(&mut self, data: &[u8]) -> Option<()>

Process CertificateVerify message

Source

pub fn process_finished(&mut self, data: &[u8]) -> Option<()>

Process server Finished message and derive application traffic secrets

Source

pub fn build_client_finished(&self) -> Option<Vec<u8>>

Build the client Finished message

Trait Implementations§

Source§

impl Default for HandshakeEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for HandshakeEngine

§

impl RefUnwindSafe for HandshakeEngine

§

impl Send for HandshakeEngine

§

impl Sync for HandshakeEngine

§

impl Unpin for HandshakeEngine

§

impl UnwindSafe for HandshakeEngine

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.