43#define LOG_MODULE "EDHOC-Trace"
44#define LOG_LEVEL LOG_LEVEL_EDHOC
49 const uint8_t *msg_data,
53 if(LOG_LEVEL >= LOG_LEVEL_DBG) {
54 const char *direction = is_tx ?
"TX" :
"RX";
55 LOG_DBG_(
"%s message_%d CBOR (%zu bytes): ", direction, msg_num, msg_len);
57 LOG_DBG_BYTES(msg_data, msg_len);
69 if(LOG_LEVEL >= LOG_LEVEL_DBG) {
70 LOG_DBG(
"=== %s Ephemeral Key Generation ===\n", role_label);
83#if EDHOC_TEST == EDHOC_TEST_VECTOR_TRACE_DH
90 LOG_DBG(
"Ephemeral private key: [hidden for security]\n");
98 const uint8_t *th_data,
99 const uint8_t *input_data,
102 if(LOG_LEVEL >= LOG_LEVEL_DBG) {
103 LOG_DBG(
"=== Computing %s ===\n", th_label);
105 if(input_data && input_len > 0) {
107 input_data, input_len);
118 const uint8_t *prk_data,
119 const uint8_t *salt_data,
120 const uint8_t *ikm_data)
122 if(LOG_LEVEL >= LOG_LEVEL_DBG) {
123 LOG_DBG(
"=== Deriving %s ===\n", prk_label);
141 const uint8_t *mac_data,
142 const uint8_t *context_data,
145 if(LOG_LEVEL >= LOG_LEVEL_DBG) {
146 LOG_DBG(
"=== Computing %s ===\n", mac_label);
148 if(context_data && context_len > 0) {
160 const uint8_t *cred_data,
162 const uint8_t *id_cred_data,
165 if(LOG_LEVEL >= LOG_LEVEL_DBG) {
166 LOG_DBG(
"=== %s Authentication ===\n", cred_label);
168 if(id_cred_data && id_cred_len > 0) {
170 snprintf(id_label,
sizeof(id_label),
"ID_%s", cred_label);
174 if(cred_data && cred_len > 0) {
183 if(!ctx || LOG_LEVEL < LOG_LEVEL_DBG) {
187 LOG_DBG(
"=== EDHOC Session Summary ===\n");
188 LOG_DBG(
"Protocol Role: %s\n",
189 ctx->config.role == EDHOC_INITIATOR ?
"Initiator" :
"Responder");
190 LOG_DBG(
"Method: %d\n", ctx->config.method);
191 LOG_DBG(
"Cipher Suite: %d\n", ctx->state.suite_selected);
193 if(ctx->state.cid_len > 0) {
195 ctx->state.cid, ctx->state.cid_len);
198 if(ctx->state.cid_rx_len > 0) {
200 ctx->state.cid_rx, ctx->state.cid_rx_len);
203 LOG_DBG(
"Test Vector Mode: %s\n",
204 EDHOC_TEST == EDHOC_TEST_VECTOR_TRACE_DH ?
"RFC 9529" :
"Production");
206 LOG_DBG(
"Session Status: Ready for key export\n");
Common ECC types used by the EDHOC implementation.
EDHOC configuration file.
void edhoc_trace_transcript_hash(const char *th_label, const uint8_t *th_data, const uint8_t *input_data, size_t input_len)
Print transcript hash computation.
void edhoc_trace_credential(const char *cred_label, const uint8_t *cred_data, size_t cred_len, const uint8_t *id_cred_data, size_t id_cred_len)
Print credential information.
void edhoc_trace_mac_computation(const char *mac_label, const uint8_t *mac_data, const uint8_t *context_data, size_t context_len)
Print MAC computation step.
void edhoc_trace_ephemeral_key(const char *role_label, const uint8_t *pub_x, const uint8_t *pub_y, const uint8_t *priv)
Print ephemeral key generation step.
void edhoc_trace_message(uint8_t msg_num, const uint8_t *msg_data, size_t msg_len, bool is_tx)
Print EDHOC message in RFC 9529 trace format.
void edhoc_trace_session_summary(const edhoc_context_t *ctx)
Print session summary at protocol completion.
void edhoc_trace_prk_derivation(const char *prk_label, const uint8_t *prk_data, const uint8_t *salt_data, const uint8_t *ikm_data)
Print PRK derivation step.
EDHOC tracing and logging header.
#define EDHOC_TRACE_VALUE(label, data, len)
Print cryptographic value in RFC 9529 trace format.
Header file for the logging system.