Skip to content

SshPacketReader

[Source]

class ref SshPacketReader

Constructors

create

[Source]

new iso create()
: SshPacketReader iso^

Returns


Public Functions

set_decrypt_ctx

[Source]

fun ref set_decrypt_ctx(
  ctx: SshCipherContext ref,
  mac_digest_len: USize val = 16,
  is_aead: Bool val = true)
: None val

Parameters

Returns


set_gcm_params

[Source]

Set up per-packet GCM decryption. A fresh cipher context is created per packet. iv must be 12 bytes. The last 8 bytes are incremented per packet.

fun ref set_gcm_params(
  key: Array[U8 val] val,
  iv: Array[U8 val] val)
: None val

Parameters

Returns


set_stream_cipher

[Source]

Set up streaming decryption (CTR/CBC) with HMAC verification.

fun ref set_stream_cipher(
  ctx: SshCipherContext ref,
  mac_key: Array[U8 val] val,
  mac_len: USize val,
  block_size: USize val = 16,
  use_sha512: Bool val = false)
: None val

Parameters

Returns


clear_decrypt_ctx

[Source]

fun ref clear_decrypt_ctx()
: None val

Returns


append

[Source]

Append incoming TCP bytes to the internal buffer.

fun ref append(
  data: Array[U8 val] val)
: None val

Parameters

Returns


read

[Source]

Try to read one complete packet from the buffer. Returns: - payload (Array[U8] val) on success - SshTransportError on protocol error - None if not enough data yet

fun ref read()
: (Array[U8 val] val | SshTransportError | None val)

Returns


read_line

[Source]

Scan the buffer for a line ending in \n. Returns the line content without the trailing \r\n (or \n), or None if no complete line yet.

fun ref read_line()
: (String val | None val)

Returns


sequence_number

[Source]

fun box sequence_number()
: U32 val

Returns