ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
SshSession Struct Reference

SSH transport/session state for one connection (BSS pool). More...

#include <transport.h>

Public Attributes

SshPhase phase
 Current handshake phase.
 
SshKexAlg kex_alg
 negotiated in KEXINIT.
 
SshHostkeyAlg hostkey_alg
 negotiated in KEXINIT.
 
uint8_t cipher_alg_c2s
 SSH_CIPHER_* client-to-server.
 
uint8_t cipher_alg_s2c
 SSH_CIPHER_* server-to-client.
 
uint8_t mac_alg_c2s
 SSH_MAC_* client-to-server (aes cipher only; 0 = hmac-sha2-256).
 
uint8_t mac_alg_s2c
 SSH_MAC_* server-to-client (aes cipher only; 0 = hmac-sha2-256).
 
uint8_t * ecdh_sk
 32B: X25519 scalar / P-256 d, ephemeral private. Wiped by ssh_dh_wipe().
 
uint8_t * ecdh_pk
 32B: X25519 ephemeral public (curve25519 KEX only).
 
char * v_c
 SSH_VERSION_MAX: client identification string (no CR LF).
 
uint16_t v_c_len
 Length of v_c.
 
char * v_s
 SSH_VERSION_MAX: server identification string (no CR LF).
 
uint16_t v_s_len
 Length of v_s.
 
uint8_t * ident_buf
 SSH_VERSION_MAX: accumulator for the inbound identification string.
 
uint16_t ident_len
 Bytes buffered in ident_buf.
 
uint8_t * i_c
 PROTOCORE_SSH_I_C_MAX: client KEXINIT payload (for H).
 
uint16_t i_c_len
 Length of i_c.
 
uint8_t * i_s
 PROTOCORE_SSH_I_S_MAX: server KEXINIT payload (for H).
 
uint16_t i_s_len
 Length of i_s.
 
uint8_t * cpub
 PROTOCORE_SSH_CPUB_MAX: exchange value the client sent - e, Q_C or C_INIT (for H).
 
uint16_t cpub_len
 Length of cpub.
 
uint8_t * session_id
 SSH_KEXHASH_MAX_LEN: H from the first KEX (RFC 4253 sec 7.2).
 
uint8_t session_id_len
 Session id length (the first KEX's exchange-hash length).
 
proto_bool have_session_id
 True once the first KEX completes.
 
SshDir out
 Our outbound direction: encrypted once we sent NEWKEYS, and the epoch it reads.
 
SshDir in
 Our inbound direction: encrypted once the peer's arrives.
 
proto_bool kex_active
 An exchange is running, from KEXINIT to NEWKEYS (sec 9).
 
proto_bool kexinit_sent
 This end has sent its KEXINIT and not yet its NEWKEYS (sec 7.1).
 
SshPhase phase_before_kex
 What to resume when this exchange completes (sec 9).
 
proto_bool drop_guessed_kex_pkt
 The peer guessed a KEX that lost negotiation (sec 7.1).
 
proto_bool ext_info_enabled
 Peer offered its role's RFC 8308 sec 2.2 indicator.
 
proto_bool ext_info_sent
 EXT_INFO already went out; RFC 8308 sec 2.4 allows it once.
 
proto_bool authed
 True after successful user authentication.
 
uint32_t last_kex_ms
 protocore_millis() when the last KEX completed.
 

Detailed Description

SSH transport/session state for one connection (BSS pool).

Holds the handshake phase plus the values that must persist across messages to compute the exchange hash H: the identification strings (V_C, V_S) and the two KEXINIT payloads (I_C, I_S). The exchange hash from the first KEX is retained as the session id.

Definition at line 63 of file transport.h.

Member Data Documentation

◆ phase

SshPhase SshSession::phase

Current handshake phase.

Definition at line 65 of file transport.h.

◆ kex_alg

SshKexAlg SshSession::kex_alg

negotiated in KEXINIT.

Definition at line 67 of file transport.h.

◆ hostkey_alg

SshHostkeyAlg SshSession::hostkey_alg

negotiated in KEXINIT.

Definition at line 68 of file transport.h.

◆ cipher_alg_c2s

uint8_t SshSession::cipher_alg_c2s

SSH_CIPHER_* client-to-server.

Definition at line 71 of file transport.h.

◆ cipher_alg_s2c

uint8_t SshSession::cipher_alg_s2c

SSH_CIPHER_* server-to-client.

Definition at line 72 of file transport.h.

◆ mac_alg_c2s

uint8_t SshSession::mac_alg_c2s

SSH_MAC_* client-to-server (aes cipher only; 0 = hmac-sha2-256).

Definition at line 73 of file transport.h.

◆ mac_alg_s2c

uint8_t SshSession::mac_alg_s2c

SSH_MAC_* server-to-client (aes cipher only; 0 = hmac-sha2-256).

Definition at line 74 of file transport.h.

◆ ecdh_sk

uint8_t* SshSession::ecdh_sk

32B: X25519 scalar / P-256 d, ephemeral private. Wiped by ssh_dh_wipe().

Definition at line 78 of file transport.h.

◆ ecdh_pk

uint8_t* SshSession::ecdh_pk

32B: X25519 ephemeral public (curve25519 KEX only).

Definition at line 79 of file transport.h.

◆ v_c

char* SshSession::v_c

SSH_VERSION_MAX: client identification string (no CR LF).

Definition at line 81 of file transport.h.

◆ v_c_len

uint16_t SshSession::v_c_len

Length of v_c.

Definition at line 82 of file transport.h.

◆ v_s

char* SshSession::v_s

SSH_VERSION_MAX: server identification string (no CR LF).

Definition at line 83 of file transport.h.

◆ v_s_len

uint16_t SshSession::v_s_len

Length of v_s.

Definition at line 84 of file transport.h.

◆ ident_buf

uint8_t* SshSession::ident_buf

SSH_VERSION_MAX: accumulator for the inbound identification string.

Definition at line 86 of file transport.h.

◆ ident_len

uint16_t SshSession::ident_len

Bytes buffered in ident_buf.

Definition at line 87 of file transport.h.

◆ i_c

uint8_t* SshSession::i_c

PROTOCORE_SSH_I_C_MAX: client KEXINIT payload (for H).

Definition at line 89 of file transport.h.

◆ i_c_len

uint16_t SshSession::i_c_len

Length of i_c.

Definition at line 90 of file transport.h.

◆ i_s

uint8_t* SshSession::i_s

PROTOCORE_SSH_I_S_MAX: server KEXINIT payload (for H).

Definition at line 91 of file transport.h.

◆ i_s_len

uint16_t SshSession::i_s_len

Length of i_s.

Definition at line 92 of file transport.h.

◆ cpub

uint8_t* SshSession::cpub

PROTOCORE_SSH_CPUB_MAX: exchange value the client sent - e, Q_C or C_INIT (for H).

Definition at line 94 of file transport.h.

◆ cpub_len

uint16_t SshSession::cpub_len

Length of cpub.

Definition at line 95 of file transport.h.

◆ session_id

uint8_t* SshSession::session_id

SSH_KEXHASH_MAX_LEN: H from the first KEX (RFC 4253 sec 7.2).

Definition at line 97 of file transport.h.

◆ session_id_len

uint8_t SshSession::session_id_len

Session id length (the first KEX's exchange-hash length).

Definition at line 98 of file transport.h.

◆ have_session_id

proto_bool SshSession::have_session_id

True once the first KEX completes.

Definition at line 99 of file transport.h.

◆ out

SshDir SshSession::out

Our outbound direction: encrypted once we sent NEWKEYS, and the epoch it reads.

Definition at line 103 of file transport.h.

◆ in

SshDir SshSession::in

Our inbound direction: encrypted once the peer's arrives.

Definition at line 104 of file transport.h.

◆ kex_active

proto_bool SshSession::kex_active

An exchange is running, from KEXINIT to NEWKEYS (sec 9).

Definition at line 106 of file transport.h.

◆ kexinit_sent

proto_bool SshSession::kexinit_sent

This end has sent its KEXINIT and not yet its NEWKEYS (sec 7.1).

Definition at line 110 of file transport.h.

◆ phase_before_kex

SshPhase SshSession::phase_before_kex

What to resume when this exchange completes (sec 9).

Definition at line 114 of file transport.h.

◆ drop_guessed_kex_pkt

proto_bool SshSession::drop_guessed_kex_pkt

The peer guessed a KEX that lost negotiation (sec 7.1).

Definition at line 115 of file transport.h.

◆ ext_info_enabled

proto_bool SshSession::ext_info_enabled

Peer offered its role's RFC 8308 sec 2.2 indicator.

Definition at line 116 of file transport.h.

◆ ext_info_sent

proto_bool SshSession::ext_info_sent

EXT_INFO already went out; RFC 8308 sec 2.4 allows it once.

Definition at line 117 of file transport.h.

◆ authed

proto_bool SshSession::authed

True after successful user authentication.

Definition at line 118 of file transport.h.

◆ last_kex_ms

uint32_t SshSession::last_kex_ms

protocore_millis() when the last KEX completed.

Definition at line 119 of file transport.h.


The documentation for this struct was generated from the following file: