Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

CoAP OSCORE API. More...

Data Structures

struct  coap_oscore_exchange
 OSCORE exchange entry. More...
struct  coap_oscore_init_params
 OSCORE security context derivation parameters (RFC 8613 Section 3.2). More...

Enumerations

enum  coap_oscore_aead_alg { COAP_OSCORE_AEAD_AES_CCM_16_64_128 = 0 }
 AEAD algorithm used to protect OSCORE messages (RFC 8613 Section 3.1). More...
enum  coap_oscore_hkdf { COAP_OSCORE_HKDF_SHA_256 = 0 }
 HKDF algorithm used to derive OSCORE keys (RFC 8613 Section 3.1). More...

Functions

int coap_oscore_context_init (struct coap_oscore_init_params *params, struct coap_oscore_context **ctx)
 Initialize an OSCORE security context.
void coap_oscore_context_free (struct coap_oscore_context *ctx)
 Release an OSCORE security context.

Detailed Description

CoAP OSCORE API.

Since
4.5
Version
0.1.0

Enumeration Type Documentation

◆ coap_oscore_aead_alg

#include <coap_oscore.h>

AEAD algorithm used to protect OSCORE messages (RFC 8613 Section 3.1).

Enumerator
COAP_OSCORE_AEAD_AES_CCM_16_64_128 

AES-CCM mode 128-bit key, 64-bit tag, 13-byte nonce.

◆ coap_oscore_hkdf

#include <coap_oscore.h>

HKDF algorithm used to derive OSCORE keys (RFC 8613 Section 3.1).

Enumerator
COAP_OSCORE_HKDF_SHA_256 

HKDF-SHA-256.

Function Documentation

◆ coap_oscore_context_free()

void coap_oscore_context_free ( struct coap_oscore_context * ctx)

#include <coap_oscore.h>

Release an OSCORE security context.

Returns the context to the pool. The caller must ensure the context is no longer attached to any CoAP client or service before freeing it. Passing NULL is a no-op.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_COAP_OSCORE 
.
Parameters
ctxContext previously returned by coap_oscore_context_init().

◆ coap_oscore_context_init()

int coap_oscore_context_init ( struct coap_oscore_init_params * params,
struct coap_oscore_context ** ctx )

#include <coap_oscore.h>

Initialize an OSCORE security context.

Derives the common, sender and recipient contexts from params (RFC 8613 Section 3.2) and returns an opaque handle that can be attached to a CoAP client or service. Contexts are allocated from a fixed pool sized by

CONFIG_COAP_OSCORE_MAX_CONTEXTS 

and released with coap_oscore_context_free().

Attention
Available only when the following Kconfig option is enabled:
CONFIG_COAP_OSCORE 
.
Parameters
paramsDerivation parameters.
ctxOn success, set to the newly created context handle.
Return values
0on success.
-EINVALif params or ctx is NULL, or a required parameter is missing, or the context could not be derived.
-ENOMEMif no free context slot is available.