libcoap 4.3.3
|
API functions for interfacing with OSCORE (RFC8613) More...
Typedefs | |
typedef int(* | coap_oscore_save_seq_num_t) (uint64_t sender_seq_num, void *param) |
Definition of the function used to save the current Sender Sequence Number. More... | |
Functions | |
int | coap_oscore_is_supported (void) |
Check whether OSCORE is available. More... | |
coap_session_t * | coap_new_client_session_oscore (coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_oscore_conf_t *oscore_conf) |
Creates a new client session to the designated server, protecting the data using OSCORE. More... | |
coap_session_t * | coap_new_client_session_oscore_psk (coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_dtls_cpsk_t *psk_data, coap_oscore_conf_t *oscore_conf) |
Creates a new client session to the designated server with PSK credentials as well as protecting the data using OSCORE. More... | |
coap_session_t * | coap_new_client_session_oscore_pki (coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_dtls_pki_t *pki_data, coap_oscore_conf_t *oscore_conf) |
Creates a new client session to the designated server with PKI credentials as well as protecting the data using OSCORE. More... | |
int | coap_context_oscore_server (coap_context_t *context, coap_oscore_conf_t *oscore_conf) |
Set the context's default OSCORE configuration for a server. More... | |
coap_oscore_conf_t * | coap_new_oscore_conf (coap_str_const_t conf_mem, coap_oscore_save_seq_num_t save_seq_num_func, void *save_seq_num_func_param, uint64_t start_seq_num) |
Parse an OSCORE configuration (held in memory) and populate a OSCORE configuration structure. More... | |
int | coap_delete_oscore_conf (coap_oscore_conf_t *oscore_conf) |
Release all the information associated with the OSCORE configuration. More... | |
int | coap_new_oscore_recipient (coap_context_t *context, coap_bin_const_t *recipient_id) |
Add in the specific Recipient ID into the OSCORE context (server only). More... | |
int | coap_delete_oscore_recipient (coap_context_t *context, coap_bin_const_t *recipient_id) |
Release all the information associated for the specific Recipient ID (and hence and stop any further OSCORE protection for this Recipient). More... | |
API functions for interfacing with OSCORE (RFC8613)
typedef int(* coap_oscore_save_seq_num_t) (uint64_t sender_seq_num, void *param) |
Definition of the function used to save the current Sender Sequence Number.
sender_seq_num | The Sender Sequence Number to save in non-volatile memory. |
param | The save_seq_num_func_param provided to coap_new_oscore_context(). |
1
if success, else 0
if a failure of some sort. Definition at line 137 of file coap_oscore.h.
int coap_context_oscore_server | ( | coap_context_t * | context, |
coap_oscore_conf_t * | oscore_conf | ||
) |
Set the context's default OSCORE configuration for a server.
context | The current coap_context_t object. |
oscore_conf | OSCORE configuration information. This structure is freed off by this call. |
1
if successful, else 0
. Definition at line 2155 of file coap_oscore.c.
int coap_delete_oscore_conf | ( | coap_oscore_conf_t * | oscore_conf | ) |
Release all the information associated with the OSCORE configuration.
oscore_conf | The OSCORE configuration structure to release. |
1
Successfully removed, else 0
not found. Definition at line 2175 of file coap_oscore.c.
int coap_delete_oscore_recipient | ( | coap_context_t * | context, |
coap_bin_const_t * | recipient_id | ||
) |
Release all the information associated for the specific Recipient ID (and hence and stop any further OSCORE protection for this Recipient).
Note: This is only removed from the OSCORE context as first defined by coap_new_client_session_oscore*() or coap_context_oscore_server().
context | The CoAP context holding the OSCORE recipient_id to. |
recipient_id | The Recipient ID to remove. |
1
Successfully removed, else 0
not found. Definition at line 2189 of file coap_oscore.c.
coap_session_t * coap_new_client_session_oscore | ( | coap_context_t * | ctx, |
const coap_address_t * | local_if, | ||
const coap_address_t * | server, | ||
coap_proto_t | proto, | ||
coap_oscore_conf_t * | oscore_conf | ||
) |
Creates a new client session to the designated server, protecting the data using OSCORE.
ctx | The CoAP context. |
local_if | Address of local interface. It is recommended to use NULL to let the operating system choose a suitable local interface. If an address is specified, the port number should be zero, which means that a free port is automatically selected. |
server | The server's address. If the port number is zero, the default port for the protocol will be used. |
proto | CoAP Protocol. |
oscore_conf | OSCORE configuration information. This structure is freed off by this call. |
Definition at line 2109 of file coap_oscore.c.
coap_session_t * coap_new_client_session_oscore_pki | ( | coap_context_t * | ctx, |
const coap_address_t * | local_if, | ||
const coap_address_t * | server, | ||
coap_proto_t | proto, | ||
coap_dtls_pki_t * | pki_data, | ||
coap_oscore_conf_t * | oscore_conf | ||
) |
Creates a new client session to the designated server with PKI credentials as well as protecting the data using OSCORE.
ctx | The CoAP context. |
local_if | Address of local interface. It is recommended to use NULL to let the operating system choose a suitable local interface. If an address is specified, the port number should be zero, which means that a free port is automatically selected. |
server | The server's address. If the port number is zero, the default port for the protocol will be used. |
proto | CoAP Protocol. |
pki_data | PKI parameters. |
oscore_conf | OSCORE configuration information. This structure is freed off by this call. |
Definition at line 2139 of file coap_oscore.c.
coap_session_t * coap_new_client_session_oscore_psk | ( | coap_context_t * | ctx, |
const coap_address_t * | local_if, | ||
const coap_address_t * | server, | ||
coap_proto_t | proto, | ||
coap_dtls_cpsk_t * | psk_data, | ||
coap_oscore_conf_t * | oscore_conf | ||
) |
Creates a new client session to the designated server with PSK credentials as well as protecting the data using OSCORE.
ctx | The CoAP context. |
local_if | Address of local interface. It is recommended to use NULL to let the operating system choose a suitable local interface. If an address is specified, the port number should be zero, which means that a free port is automatically selected. |
server | The server's address. If the port number is zero, the default port for the protocol will be used. |
proto | CoAP Protocol. |
psk_data | PSK parameters. |
oscore_conf | OSCORE configuration information. This structure is freed off by this call. |
Definition at line 2123 of file coap_oscore.c.
coap_oscore_conf_t * coap_new_oscore_conf | ( | coap_str_const_t | conf_mem, |
coap_oscore_save_seq_num_t | save_seq_num_func, | ||
void * | save_seq_num_func_param, | ||
uint64_t | start_seq_num | ||
) |
Parse an OSCORE configuration (held in memory) and populate a OSCORE configuration structure.
conf_mem | The current configuration in memory. |
save_seq_num_func | Function to call to save Sender Sequence Number in non-volatile memory, or NULL. |
save_seq_num_func_param | Parameter to pass into save_seq_num_func() function. |
start_seq_num | The Sender Sequence Number to start with following a reboot retrieved out of non-volatile menory or 0. |
Definition at line 2163 of file coap_oscore.c.
int coap_new_oscore_recipient | ( | coap_context_t * | context, |
coap_bin_const_t * | recipient_id | ||
) |
Add in the specific Recipient ID into the OSCORE context (server only).
Note: This is only added to the OSCORE context as first defined by coap_new_client_session_oscore*() or coap_context_oscore_server().
context | The CoAP context to add the OSCORE recipient_id to. |
recipient_id | The Recipient ID to add. |
1
Successfully added, else 0
there is an issue. Definition at line 2181 of file coap_oscore.c.
int coap_oscore_is_supported | ( | void | ) |
Check whether OSCORE is available.
1
if support for OSCORE is enabled, or 0
otherwise. Definition at line 2104 of file coap_oscore.c.