131#define EDHOC_SUCCESS_CHECK(result) ((result) == EDHOC_SUCCESS)
138#define EDHOC_FAILED(result) ((result) < EDHOC_SUCCESS)
171 int line,
const char *function,
172 const char *message);
185#define EDHOC_ERROR(code, msg) \
186 edhoc_set_error_context((code), __FILE__, __LINE__, __func__, (msg))
193#define EDHOC_CHECK(call) do { \
194 edhoc_error_t _result = (call); \
195 if(EDHOC_FAILED(_result)) { \
edhoc_error_t edhoc_set_error_context(edhoc_error_t code, const char *file, int line, const char *function, const char *message)
Set error context for debugging (internal use).
edhoc_error_t
Unified error type for EDHOC operations.
@ EDHOC_ERR_CBOR_ENCODING
CBOR encoding failed.
@ EDHOC_ERR_CRYPTO_DECRYPT
Decryption operation failed.
@ EDHOC_ERR_CREDENTIAL_INVALID
Invalid credential.
@ EDHOC_ERR_CREDENTIAL_NOT_FOUND
Credential not found.
@ EDHOC_ERR_ALREADY_INITIALIZED
Already initialized.
@ EDHOC_ERR_CRYPTO_VERIFY
Signature verification failed.
@ EDHOC_ERR_STORAGE_INIT_FAILED
Storage initialization failed.
@ EDHOC_ERR_NETWORK_TIMEOUT
Network operation timeout.
@ EDHOC_ERR_NULL_POINTER
Null pointer provided.
@ EDHOC_ERR_CRYPTO_HASH
Hash operation failed.
@ EDHOC_ERR_NETWORK_CONNECTION
Network connection error.
@ EDHOC_ERR_MESSAGE_TOO_LARGE
Message too large for transport.
@ EDHOC_ERR_ID_CRED_MALFORMED
Malformed credential identifier.
@ EDHOC_ERR_CRITICAL_EAD_UNSUPPORTED
Critical EAD item cannot be processed (RFC 9528 Section 6).
@ EDHOC_ERR_CRYPTO_ENCRYPT
Encryption operation failed.
@ EDHOC_ERR_INTERNAL_ERROR
Internal implementation error.
@ EDHOC_ERR_CRYPTO_INVALID_KEY
Invalid cryptographic key.
@ EDHOC_ERR_WRONG_CID
Wrong connection identifier.
@ EDHOC_ERR_CRYPTO_AUTHENTICATION
Authentication failed.
@ EDHOC_ERR_INVALID_STATE
Invalid context state.
@ EDHOC_ERR_KEY_NOT_FOUND
Key not found in storage.
@ EDHOC_ERR_DUPLICATE_KEY
Duplicate key in storage.
@ EDHOC_ERR_CRYPTO_KDF
Key derivation failed.
@ EDHOC_ERR_NOT_IMPLEMENTED
Feature not implemented.
@ EDHOC_ERR_BUFFER_OVERFLOW
Buffer overflow detected.
@ EDHOC_ERR_SUITE_NOT_SUPPORTED
Cipher suite not supported.
@ EDHOC_ERR_MSG_MALFORMED
Malformed message received.
@ EDHOC_ERR_COAP_ERROR
CoAP protocol error.
@ EDHOC_ERR_CORRELATION
Message correlation error.
@ EDHOC_ERR_KEY_STORAGE_FULL
Key storage is full.
@ EDHOC_ERR_INVALID_LENGTH
Invalid length parameter.
@ EDHOC_ERR_UNKNOWN
Unknown error condition.
@ EDHOC_ERR_CID_INVALID
Invalid connection identifier.
@ EDHOC_ERR_NOT_ALLOWED_IDENTITY
Identity not allowed.
@ EDHOC_ERR_BUFFER_TOO_SMALL
Provided buffer is too small.
@ EDHOC_ERR_CRYPTO_KEYGEN
Key generation failed.
@ EDHOC_ERR_CBOR_MALFORMED
Malformed CBOR data.
@ EDHOC_ERR_CRYPTO_SIGN
Digital signature failed.
@ EDHOC_ERR_CONTEXT_NOT_INITIALIZED
Context not initialized.
@ EDHOC_ERR_METHOD_NOT_SUPPORTED
EDHOC method not supported.
@ EDHOC_ERR_CBOR_DECODING
CBOR decoding failed.
@ EDHOC_ERR_CBOR_INVALID_TYPE
Invalid CBOR data type.
@ EDHOC_ERR_INVALID_PARAMETER
Invalid parameter provided.
@ EDHOC_ERR_MEMORY_ALLOCATION
Memory allocation failed.
@ EDHOC_ERR_SEQUENCE_ERROR
Message sequence error.
const char * edhoc_error_string(edhoc_error_t error)
Get a human-readable error message for an error code.
const edhoc_error_context_t * edhoc_get_last_error_context(void)
Get the last error context (for debugging).
Error context structure for debugging.
const char * message
Additional error message.
int line
Line number where error occurred.
const char * function
Function where error occurred.
const char * file
Source file where error occurred.
edhoc_error_t code
Error code.