libcoap 4.3.5-develop-19cef11
oscore_context.c File Reference

An implementation of the Object Security for Constrained RESTful Environments (RFC 8613). More...

#include "coap3/coap_libcoap_build.h"
#include <stdio.h>
+ Include dependency graph for oscore_context.c:

Go to the source code of this file.

Macros

#define OSCORE_LOG_SIZE   16
 

Functions

static void oscore_enter_context (coap_context_t *c_context, oscore_ctx_t *osc_ctx)
 
static size_t compose_info (uint8_t *buffer, size_t buf_size, uint8_t alg, coap_bin_const_t *id, coap_bin_const_t *id_context, coap_str_const_t *type, size_t out_len)
 
uint8_t oscore_bytes_equal (uint8_t *a_ptr, uint8_t a_len, uint8_t *b_ptr, uint8_t b_len)
 
static void oscore_free_recipient (oscore_recipient_ctx_t *recipient)
 
void oscore_free_context (oscore_ctx_t *osc_ctx)
 
void oscore_free_contexts (coap_context_t *c_context)
 
int oscore_remove_context (coap_context_t *c_context, oscore_ctx_t *osc_ctx)
 
oscore_ctx_toscore_find_context (const coap_context_t *c_context, const coap_bin_const_t rcpkey_id, const coap_bin_const_t *ctxkey_id, uint8_t *oscore_r2, oscore_recipient_ctx_t **recipient_ctx)
 oscore_find_context - Locate recipient context (and hence OSCORE context) More...
 
void oscore_log_hex_value (coap_log_t level, const char *name, coap_bin_const_t *value)
 
void oscore_log_int_value (coap_log_t level, const char *name, int value)
 
void oscore_log_char_value (coap_log_t level, const char *name, const char *value)
 
void oscore_convert_to_hex (const uint8_t *src, size_t src_len, char *dest, size_t dst_len)
 
static coap_bin_const_toscore_build_key (oscore_ctx_t *osc_ctx, coap_bin_const_t *id, coap_str_const_t *type, size_t out_len)
 
static void oscore_log_context (oscore_ctx_t *osc_ctx, const char *heading)
 
void oscore_update_ctx (oscore_ctx_t *osc_ctx, coap_bin_const_t *id_context)
 oscore_update_ctx - update a osc_ctx with a new id_context More...
 
oscore_ctx_toscore_duplicate_ctx (coap_context_t *c_context, oscore_ctx_t *o_osc_ctx, coap_bin_const_t *sender_id, coap_bin_const_t *recipient_id, coap_bin_const_t *id_context)
 oscore_duplicate_ctx - duplicate a osc_ctx More...
 
oscore_ctx_toscore_derive_ctx (coap_context_t *c_context, coap_oscore_conf_t *oscore_conf)
 oscore_derive_ctx - derive a osc_ctx from oscore_conf information More...
 
oscore_recipient_ctx_toscore_add_recipient (oscore_ctx_t *osc_ctx, coap_bin_const_t *rid, uint32_t break_key)
 oscore_add_recipient - add in recipient information More...
 
int oscore_delete_recipient (oscore_ctx_t *osc_ctx, coap_bin_const_t *rid)
 
void oscore_free_association (oscore_association_t *association)
 
int oscore_new_association (coap_session_t *session, coap_pdu_t *sent_pdu, coap_bin_const_t *token, oscore_recipient_ctx_t *recipient_ctx, coap_bin_const_t *aad, coap_bin_const_t *nonce, coap_bin_const_t *partial_iv, int is_observe)
 
oscore_association_toscore_find_association (coap_session_t *session, coap_bin_const_t *token)
 
int oscore_delete_association (coap_session_t *session, oscore_association_t *association)
 
void oscore_delete_server_associations (coap_session_t *session)
 

Detailed Description

An implementation of the Object Security for Constrained RESTful Environments (RFC 8613).

Author
Martin Gunnarsson marti.nosp@m.n.gu.nosp@m.nnars.nosp@m.son@.nosp@m.ri.se adapted for libcoap Peter van der Stok consu.nosp@m.ltan.nosp@m.cy@va.nosp@m.nder.nosp@m.stok..nosp@m.org on request of Fairhair alliance adapted for libcoap integration Jon Shallow supjp.nosp@m.s-li.nosp@m.bcoap.nosp@m.@jps.nosp@m.hallo.nosp@m.w.co.nosp@m.m

Definition in file oscore_context.c.

Macro Definition Documentation

◆ OSCORE_LOG_SIZE

#define OSCORE_LOG_SIZE   16

Definition at line 233 of file oscore_context.c.

Function Documentation

◆ compose_info()

static size_t compose_info ( uint8_t *  buffer,
size_t  buf_size,
uint8_t  alg,
coap_bin_const_t id,
coap_bin_const_t id_context,
coap_str_const_t type,
size_t  out_len 
)
static

Definition at line 54 of file oscore_context.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ oscore_build_key()

static coap_bin_const_t * oscore_build_key ( oscore_ctx_t osc_ctx,
coap_bin_const_t id,
coap_str_const_t type,
size_t  out_len 
)
static

Definition at line 309 of file oscore_context.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ oscore_enter_context()

static void oscore_enter_context ( coap_context_t c_context,
oscore_ctx_t osc_ctx 
)
static

Definition at line 103 of file oscore_context.c.

+ Here is the caller graph for this function:

◆ oscore_free_recipient()

static void oscore_free_recipient ( oscore_recipient_ctx_t recipient)
static

Definition at line 118 of file oscore_context.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ oscore_log_context()

static void oscore_log_context ( oscore_ctx_t osc_ctx,
const char *  heading 
)
static

Definition at line 341 of file oscore_context.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: