|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
CoAP OSCORE API. More...
Data Structures | |
| struct | coap_oscore_init_params |
| OSCORE security context derivation parameters (RFC 8613 Section 3.2). More... | |
| struct | coap_oscore_exchange |
| OSCORE exchange entry. 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_add (const struct coap_oscore_init_params *params, struct coap_oscore_context **ctx) |
| Add an OSCORE security context. | |
| int | coap_oscore_context_remove (struct coap_oscore_context *ctx) |
| Remove an OSCORE security context. | |
CoAP OSCORE API.
| enum coap_oscore_aead_alg |
#include <zephyr/net/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. |
| enum coap_oscore_hkdf |
#include <zephyr/net/coap_oscore.h>
HKDF algorithm used to derive OSCORE keys (RFC 8613 Section 3.1).
| Enumerator | |
|---|---|
| COAP_OSCORE_HKDF_SHA_256 | HKDF-SHA-256. |
| int coap_oscore_context_add | ( | const struct coap_oscore_init_params * | params, |
| struct coap_oscore_context ** | ctx ) |
#include <zephyr/net/coap_oscore.h>
Add an OSCORE security context.
Derives the common, sender and recipient contexts from params (RFC 8613 Section 3.2) and adds them to the pool of contexts that can be used with the CoAP server. Contexts are allocated from a fixed pool sized by CONFIG_COAP_OSCORE_MAX_CONTEXTS and released with coap_oscore_context_remove(). Each context corresponds to one client identity (Recipient ID); add one context per client to serve multiple clients concurrently.
CONFIG_COAP_OSCORE.| params | Derivation parameters. |
| ctx | On success, set to the newly created context handle. |
| 0 | on success. |
| -EINVAL | if params is NULL, a required parameter is missing or has an invalid size, or the context could not be derived. |
| -ENOTSUP | if fresh_master_secret_salt is false while CONFIG_COAP_OSCORE_CONTEXT_REUSE is disabled. |
| -ENOMEM | if no free context slot is available. |
| int coap_oscore_context_remove | ( | struct coap_oscore_context * | ctx | ) |
#include <zephyr/net/coap_oscore.h>
Remove an OSCORE security context.
Removes the context from the pool of contexts that can be used with the CoAP server. The context is reference-counted: if an in-flight request, an active exchange, or an observer still references it, the context is retained and -EAGAIN is returned. Retry once those references have been released. Passing NULL returns -EINVAL.
CONFIG_COAP_OSCORE.| ctx | Context handle to remove. |
| 0 | on success. |
| -EAGAIN | if the context is in use and cannot be removed. |
| -EINVAL | if ctx is NULL or not a valid context handle. |