Struct esp_idf_sys::mbedtls_ssl_context

source ·
#[repr(C)]
pub struct mbedtls_ssl_context {
Show 59 fields pub private_conf: *const mbedtls_ssl_config, pub private_state: c_int, pub private_renego_status: c_int, pub private_renego_records_seen: c_int, pub private_tls_version: mbedtls_ssl_protocol_version, pub private_badmac_seen: c_uint, pub private_f_vrfy: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: *mut mbedtls_x509_crt, arg3: c_int, arg4: *mut u32) -> c_int>, pub private_p_vrfy: *mut c_void, pub private_f_send: mbedtls_ssl_send_t, pub private_f_recv: mbedtls_ssl_recv_t, pub private_f_recv_timeout: mbedtls_ssl_recv_timeout_t, pub private_p_bio: *mut c_void, pub private_session_in: *mut mbedtls_ssl_session, pub private_session_out: *mut mbedtls_ssl_session, pub private_session: *mut mbedtls_ssl_session, pub private_session_negotiate: *mut mbedtls_ssl_session, pub private_handshake: *mut mbedtls_ssl_handshake_params, pub private_transform_in: *mut mbedtls_ssl_transform, pub private_transform_out: *mut mbedtls_ssl_transform, pub private_transform: *mut mbedtls_ssl_transform, pub private_transform_negotiate: *mut mbedtls_ssl_transform, pub private_p_timer: *mut c_void, pub private_f_set_timer: mbedtls_ssl_set_timer_t, pub private_f_get_timer: mbedtls_ssl_get_timer_t, pub private_in_buf: *mut c_uchar, pub private_in_ctr: *mut c_uchar, pub private_in_hdr: *mut c_uchar, pub private_in_len: *mut c_uchar, pub private_in_iv: *mut c_uchar, pub private_in_msg: *mut c_uchar, pub private_in_offt: *mut c_uchar, pub private_in_msgtype: c_int, pub private_in_msglen: usize, pub private_in_left: usize, pub private_in_hslen: usize, pub private_nb_zero: c_int, pub private_keep_current_message: c_int, pub private_send_alert: c_uchar, pub private_alert_type: c_uchar, pub private_alert_reason: c_int, pub private_out_buf: *mut c_uchar, pub private_out_ctr: *mut c_uchar, pub private_out_hdr: *mut c_uchar, pub private_out_len: *mut c_uchar, pub private_out_iv: *mut c_uchar, pub private_out_msg: *mut c_uchar, pub private_out_msgtype: c_int, pub private_out_msglen: usize, pub private_out_left: usize, pub private_cur_out_ctr: [c_uchar; 8], pub private_hostname: *mut c_char, pub private_alpn_chosen: *const c_char, pub private_secure_renegotiation: c_int, pub private_verify_data_len: usize, pub private_own_verify_data: [c_char; 12], pub private_peer_verify_data: [c_char; 12], pub private_f_export_keys: mbedtls_ssl_export_keys_t, pub private_p_export_keys: *mut c_void, pub private_user_data: mbedtls_ssl_user_data_t,
}

Fields§

§private_conf: *const mbedtls_ssl_config

< configuration information

§private_state: c_int

< SSL handshake: current state

§private_renego_status: c_int

< Initial, in progress, pending?

§private_renego_records_seen: c_int

< Records since renego request, or with DTLS, number of retransmissions of request if renego_max_records is < 0

§private_tls_version: mbedtls_ssl_protocol_version

Maximum TLS version to be negotiated, then negotiated TLS version.

It is initialized as the configured maximum TLS version to be negotiated by mbedtls_ssl_setup().

When renegotiating or resuming a session, it is overwritten in the ClientHello writing preparation stage with the previously negotiated TLS version.

On client side, it is updated to the TLS version selected by the server for the handshake when the ServerHello is received.

On server side, it is updated to the TLS version the server selects for the handshake when the ClientHello is received.

§private_badmac_seen: c_uint

< records with a bad MAC received

§private_f_vrfy: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: *mut mbedtls_x509_crt, arg3: c_int, arg4: *mut u32) -> c_int>

Callback to customize X.509 certificate chain verification

§private_p_vrfy: *mut c_void

< context for X.509 verify callback

§private_f_send: mbedtls_ssl_send_t

< Callback for network send

§private_f_recv: mbedtls_ssl_recv_t

< Callback for network receive

§private_f_recv_timeout: mbedtls_ssl_recv_timeout_t§private_p_bio: *mut c_void

< context for I/O operations

§private_session_in: *mut mbedtls_ssl_session

< current session data (in)

§private_session_out: *mut mbedtls_ssl_session

< current session data (out)

§private_session: *mut mbedtls_ssl_session

< negotiated session data

§private_session_negotiate: *mut mbedtls_ssl_session

< session data in negotiation

§private_handshake: *mut mbedtls_ssl_handshake_params

< params required only during the handshake process

§private_transform_in: *mut mbedtls_ssl_transform

< current transform params (in) This is always a reference, never an owning pointer.

§private_transform_out: *mut mbedtls_ssl_transform

< current transform params (out) This is always a reference, never an owning pointer.

§private_transform: *mut mbedtls_ssl_transform

< negotiated transform params This pointer owns the transform it references.

§private_transform_negotiate: *mut mbedtls_ssl_transform

< transform params in negotiation This pointer owns the transform it references.

§private_p_timer: *mut c_void

< context for the timer callbacks

§private_f_set_timer: mbedtls_ssl_set_timer_t

< set timer callback

§private_f_get_timer: mbedtls_ssl_get_timer_t

< get timer callback

§private_in_buf: *mut c_uchar

< input buffer

§private_in_ctr: *mut c_uchar

< 64-bit incoming message counter TLS: maintained by us DTLS: read from peer

§private_in_hdr: *mut c_uchar

< start of record header

§private_in_len: *mut c_uchar

< two-bytes message length field

§private_in_iv: *mut c_uchar

< ivlen-byte IV

§private_in_msg: *mut c_uchar

< message contents (in_iv+ivlen)

§private_in_offt: *mut c_uchar

< read offset in application data

§private_in_msgtype: c_int

< record header: message type

§private_in_msglen: usize

< record header: message length

§private_in_left: usize

< amount of data read so far

§private_in_hslen: usize

< current handshake message length, including the handshake header

§private_nb_zero: c_int

< # of 0-length encrypted messages

§private_keep_current_message: c_int

< drop or reuse current message on next call to record layer?

§private_send_alert: c_uchar

< Determines if a fatal alert should be sent. Values:

  • \c 0 , no alert is to be sent.
  • \c 1 , alert is to be sent.
§private_alert_type: c_uchar

< Type of alert if send_alert = 0

§private_alert_reason: c_int

< The error code to be returned to the user once the fatal alert has been sent.

§private_out_buf: *mut c_uchar

< output buffer

§private_out_ctr: *mut c_uchar

< 64-bit outgoing message counter

§private_out_hdr: *mut c_uchar

< start of record header

§private_out_len: *mut c_uchar

< two-bytes message length field

§private_out_iv: *mut c_uchar

< ivlen-byte IV

§private_out_msg: *mut c_uchar

< message contents (out_iv+ivlen)

§private_out_msgtype: c_int

< record header: message type

§private_out_msglen: usize

< record header: message length

§private_out_left: usize

< amount of data not yet written

§private_cur_out_ctr: [c_uchar; 8]

< Outgoing record sequence number.

§private_hostname: *mut c_char

< expected peer CN for verification (and SNI if available)

§private_alpn_chosen: *const c_char

< negotiated protocol

§private_secure_renegotiation: c_int

< does peer support legacy or secure renegotiation

§private_verify_data_len: usize

< length of verify data stored

§private_own_verify_data: [c_char; 12]

< previous handshake verify data

§private_peer_verify_data: [c_char; 12]

< previous handshake verify data

§private_f_export_keys: mbedtls_ssl_export_keys_t

Callback to export key block and master secret

§private_p_export_keys: *mut c_void

< context for key export callback

§private_user_data: mbedtls_ssl_user_data_t

User data pointer or handle.

The library sets this to \p 0 when creating a context and does not access it afterwards.

\warning Serializing and restoring an SSL context with mbedtls_ssl_context_save() and mbedtls_ssl_context_load() does not currently restore the user data.

Trait Implementations§

source§

impl Clone for mbedtls_ssl_context

source§

fn clone(&self) -> mbedtls_ssl_context

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for mbedtls_ssl_context

source§

fn default() -> Self

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

impl Copy for mbedtls_ssl_context

Auto Trait Implementations§

§

impl Freeze for mbedtls_ssl_context

§

impl RefUnwindSafe for mbedtls_ssl_context

§

impl !Send for mbedtls_ssl_context

§

impl !Sync for mbedtls_ssl_context

§

impl Unpin for mbedtls_ssl_context

§

impl UnwindSafe for mbedtls_ssl_context

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> CloneToUninit for T
where T: Copy,

§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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.