ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
extension.h File Reference

RFC 8308 extension negotiation. More...

#include "protocore_config.h"

Go to the source code of this file.

Classes

struct  ExtensionNs
 Dispatch table. Addressed by offset, so the layout is asserted below. More...
 

Macros

#define SSH_EXT_INFO_INDICATOR_MAX   sizeof(",ext-info-s")
 Bytes an indicator name takes in a kex_algorithms list, with its separating comma.
 

Functions

 PROTOCORE_NS_LAYOUT (ExtensionNs, info_indicator, build)
 
const char * protocore_extension_info_indicator (uint8_t *work, proto_bool client_role)
 The RFC 8308 sec 2.2 indicator name belonging to a role. .
 
int protocore_extension_build (uint8_t *work, uint8_t *out, size_t *len, size_t cap)
 Build SSH_MSG_EXT_INFO advertising server-sig-algs (RFC 8308). .
 

Variables

PROTOCORE_NS ExtensionNs Extension PROTOCORE_UNUSED
 Module namespace.
 

Detailed Description

RFC 8308 extension negotiation.

work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.

Definition in file extension.h.

Macro Definition Documentation

◆ SSH_EXT_INFO_INDICATOR_MAX

#define SSH_EXT_INFO_INDICATOR_MAX   sizeof(",ext-info-s")

Bytes an indicator name takes in a kex_algorithms list, with its separating comma.

Both indicator names are the same length, so one bound covers either role.

Definition at line 29 of file extension.h.

Function Documentation

◆ PROTOCORE_NS_LAYOUT()

PROTOCORE_NS_LAYOUT ( ExtensionNs  ,
info_indicator  ,
build   
)

◆ protocore_extension_info_indicator()

const char * protocore_extension_info_indicator ( uint8_t *  work,
proto_bool  client_role 
)

The RFC 8308 sec 2.2 indicator name belonging to a role. .

Parameters
workPROTOCORE_EXTENSION_BORROW bytes the caller took. Not held past the call.
client_roleTrue for the client's indicator, false for the server's
Returns
The const char *.

◆ protocore_extension_build()

int protocore_extension_build ( uint8_t *  work,
uint8_t *  out,
size_t *  len,
size_t  cap 
)

Build SSH_MSG_EXT_INFO advertising server-sig-algs (RFC 8308). .

Parameters
workPROTOCORE_EXTENSION_BORROW bytes the caller took. Not held past the call.
outOut
lenLen
capCap
Returns
The int.

Variable Documentation

◆ PROTOCORE_UNUSED

PROTOCORE_NS ExtensionNs Extension PROTOCORE_UNUSED
Initial value:
const char * protocore_extension_info_indicator(uint8_t *work, proto_bool client_role)
The RFC 8308 sec 2.2 indicator name belonging to a role. .
int protocore_extension_build(uint8_t *work, uint8_t *out, size_t *len, size_t cap)
Build SSH_MSG_EXT_INFO advertising server-sig-algs (RFC 8308). .

Module namespace.

Definition at line 57 of file extension.h.