101typedef enum : uint8_t {
134typedef enum : uint16_t {
154typedef enum : uint8_t {
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_tls_get_verify_result(ra8_tls_session_t session, uint32_t *out_flags)
Report the peer-certificate verification result for a session.
int(* ra8_tls_bio_send_fn)(void *ctx, const uint8_t *buf, size_t len)
BIO send callback signature (write ciphertext to transport).
struct ra8_tls_session_handle * ra8_tls_session_t
Opaque TLS session handle (typed pointer into the static pool).
int(* ra8_tls_bio_recv_fn)(void *ctx, uint8_t *buf, size_t len)
BIO receive callback signature (read ciphertext from transport).
ra8_err_t ra8_tls_send(ra8_tls_session_t session, const uint8_t *buf, size_t len, size_t *out_sent)
Encrypt and send application data.
ra8_err_t ra8_tls_recv(ra8_tls_session_t session, uint8_t *buf, size_t len, size_t *out_received)
Decrypt and receive application data.
ra8_tls_limits_t
Static-pool sizing constants for the TLS facade.
@ k_ra8_tls_cipher_name_cap
Capacity (bytes) a caller must reserve for a cipher-suite name.
@ k_ra8_tls_max_sessions
Maximum simultaneous TLS sessions handed out by the pool.
ra8_err_t ra8_tls_session_open(ra8_tls_session_t *out_session, const ra8_tls_session_cfg_t *cfg)
Allocate a TLS session from the static pool.
ra8_err_t ra8_tls_session_close(ra8_tls_session_t session)
Release a TLS session back to the pool.
ra8_tls_verify_mode_t
Peer-certificate verification policy for a session.
@ k_ra8_tls_verify_default
Facade default – same as required.
@ k_ra8_tls_verify_required
Verify and abort the handshake on fail.
@ k_ra8_tls_verify_none
Do not verify the peer certificate.
@ k_ra8_tls_verify_optional
Verify but do not abort on failure.
ra8_err_t ra8_tls_handshake(ra8_tls_session_t session)
Iterative TLS handshake driver.
ra8_err_t ra8_tls_get_cipher_suite(ra8_tls_session_t session, uint16_t *out_id, char *out_name, size_t name_cap)
Report the negotiated cipher suite for a session.
ra8_err_t ra8_tls_mss_clamp(uint16_t mtu, uint16_t *out_mss)
Compute the TCP MSS that keeps a segment inside one MTU frame.
ra8_err_t ra8_tls_global_deinit(void)
Symmetric tear-down for ra8_tls_global_init.
ra8_tls_net_const_t
Transport-sizing constants used by ra8_tls_mss_clamp.
@ k_ra8_tls_mtu_min
#21 pinned MTU floor (bytes).
@ k_ra8_tls_tcp_hdr_bytes
TCP header with no options.
@ k_ra8_tls_mss_min
Smallest MSS worth clamping to.
@ k_ra8_tls_ipv4_hdr_bytes
IPv4 header with no options.
ra8_err_t ra8_tls_global_init(void)
One-shot facade initialisation.
Per-session configuration handed to ra8_tls_session_open.
const char * server_name
Optional SNI hostname; NULL disables SNI.
ra8_tls_verify_mode_t verify_mode
Peer-cert policy; 0 == required (default).
ra8_tls_bio_recv_fn bio_recv
Transport read callback (required).
const char * ca_pem
Optional trust anchor, PEM; NULL == none.
ra8_tls_bio_send_fn bio_send
Transport write callback (required).
void * bio_ctx
Opaque ctx passed back to BIO callbacks.
size_t ca_pem_len
ca_pem length incl.
Forward declaration of the pool slot type.
ra8_tls_session_cfg_t cfg
Cached caller configuration.