Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
coap_oscore.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Martin Schröder <info@swedishembedded.com>
3 * Copyright (c) 2026 Siemens AG
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
14
15#ifndef ZEPHYR_INCLUDE_NET_COAP_OSCORE_H_
16#define ZEPHYR_INCLUDE_NET_COAP_OSCORE_H_
17
18#include <stddef.h>
19#include <stdint.h>
20#include <stdbool.h>
21
22#include <zephyr/net/net_ip.h>
23#include <zephyr/net/coap.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
37
49 struct net_sockaddr_storage addr;
51 uint8_t token[COAP_TOKEN_MAX_LEN];
54};
55
65struct coap_oscore_context;
66
72
78
128
149 struct coap_oscore_context **ctx);
150
162void coap_oscore_context_free(struct coap_oscore_context *ctx);
163
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* ZEPHYR_INCLUDE_NET_COAP_OSCORE_H_ */
CoAP implementation for Zephyr.
int coap_oscore_context_init(struct coap_oscore_init_params *params, struct coap_oscore_context **ctx)
Initialize an OSCORE security context.
coap_oscore_hkdf
HKDF algorithm used to derive OSCORE keys (RFC 8613 Section 3.1).
Definition coap_oscore.h:74
coap_oscore_aead_alg
AEAD algorithm used to protect OSCORE messages (RFC 8613 Section 3.1).
Definition coap_oscore.h:68
void coap_oscore_context_free(struct coap_oscore_context *ctx)
Release an OSCORE security context.
@ COAP_OSCORE_HKDF_SHA_256
HKDF-SHA-256.
Definition coap_oscore.h:76
@ COAP_OSCORE_AEAD_AES_CCM_16_64_128
AES-CCM mode 128-bit key, 64-bit tag, 13-byte nonce.
Definition coap_oscore.h:70
uint32_t net_socklen_t
Length of a socket address.
Definition net_ip.h:172
IPv6 and IPv4 definitions.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__INT64_TYPE__ int64_t
Definition stdint.h:75
OSCORE exchange entry.
Definition coap_oscore.h:48
net_socklen_t addr_len
Address length.
Definition coap_oscore.h:50
uint8_t tkl
Token length.
Definition coap_oscore.h:52
int64_t timestamp
Creation timestamp.
Definition coap_oscore.h:53
uint8_t token[COAP_TOKEN_MAX_LEN]
Token from the request.
Definition coap_oscore.h:51
struct net_sockaddr_storage addr
Client address.
Definition coap_oscore.h:49
OSCORE security context derivation parameters (RFC 8613 Section 3.2).
Definition coap_oscore.h:89
const uint8_t * id_context
ID Context (optional, set to NULL if unused).
Definition coap_oscore.h:111
size_t recipient_id_len
Length of recipient_id in bytes.
Definition coap_oscore.h:103
const uint8_t * master_salt
Master Salt (optional, set to NULL if unused).
Definition coap_oscore.h:106
size_t id_context_len
Length of id_context in bytes (0 if unused).
Definition coap_oscore.h:113
size_t sender_id_len
Length of sender_id in bytes.
Definition coap_oscore.h:98
enum coap_oscore_hkdf hkdf
KDF algorithm (use COAP_OSCORE_HKDF_SHA_256 for the default).
Definition coap_oscore.h:118
bool fresh_master_secret_salt
True if the combination of Master Secret and Master Salt is unique at every boot (e....
Definition coap_oscore.h:126
const uint8_t * recipient_id
Recipient ID (required).
Definition coap_oscore.h:101
size_t master_salt_len
Length of master_salt in bytes (0 if unused).
Definition coap_oscore.h:108
const uint8_t * master_secret
Master Secret (required, typically 16 bytes for AES-CCM-16-64-128).
Definition coap_oscore.h:91
size_t master_secret_len
Length of master_secret in bytes.
Definition coap_oscore.h:93
enum coap_oscore_aead_alg aead_alg
AEAD algorithm (use COAP_OSCORE_AEAD_AES_CCM_16_64_128 for the default).
Definition coap_oscore.h:116
const uint8_t * sender_id
Sender ID (required).
Definition coap_oscore.h:96