External Authorization Data

EDHOC carries optional EAD items in fields EAD_1EAD_4 of the four handshake messages. libedhoc exposes a thin callback interface that lets the application produce outgoing EAD tokens and inspect incoming ones without changing the protocol state machine.

Header file: include/edhoc_ead.h
group EDHOC interface EAD

Typedefs

typedef int (*edhoc_ead_compose_t)(void *user_context, enum edhoc_message message, struct edhoc_ead_token *ead_token, size_t ead_token_size, size_t *ead_token_len)

Compose external authorization data (EAD) tokens.

Called by the library during message composition to let the application attach EAD items to the outgoing EDHOC message.

Param user_context:

[in] User context.

Param message:

EDHOC message number (EAD_1, EAD_2, EAD_3, or EAD_4).

Param ead_token:

[inout] Array where the generated EAD tokens are written.

Param ead_token_size:

Maximum number of entries in the ead_token array.

Param ead_token_len:

[out] On success, the number of EAD tokens written.

Retval EDHOC_SUCCESS:

Success.

Return:

Negative error code on failure.

typedef int (*edhoc_ead_process_t)(void *user_context, enum edhoc_message message, const struct edhoc_ead_token *ead_token, size_t ead_token_size)

Process received external authorization data (EAD) tokens.

Called by the library during message processing to deliver received EAD items to the application for validation.

Param user_context:

[in] User context.

Param message:

EDHOC message number (EAD_1, EAD_2, EAD_3, or EAD_4).

Param ead_token:

[in] Array containing the received EAD tokens.

Param ead_token_size:

Number of entries in the ead_token array.

Retval EDHOC_SUCCESS:

Success.

Return:

Negative error code on failure.

Enums

enum edhoc_message

Helper type for recognition of EDHOC message in EAD callback.

Values:

enumerator EDHOC_MSG_1

EDHOC message 1.

enumerator EDHOC_MSG_2

EDHOC message 2.

enumerator EDHOC_MSG_3

EDHOC message 3.

enumerator EDHOC_MSG_4

EDHOC message 4.

struct edhoc_ead_token
#include <edhoc_ead.h>

RFC 9528: 3.8. External Authorization Data (EAD).

Public Members

int32_t label

EAD label value.

const uint8_t *value

EAD buffer.

size_t value_len

Size of the value buffer in bytes.

struct edhoc_ead
#include <edhoc_ead.h>

Bind structure for EAD operations.

Public Members

edhoc_ead_compose_t compose

External authorization data compose callback.

edhoc_ead_process_t process

External authorization data process callback.