![]() |
Contiki-NG
|
COSE library error definitions. More...
#include <stdint.h>#include <stdbool.h>Go to the source code of this file.
Macros | |
| #define | COSE_SUCCESS_CHECK(result) |
| Check if a COSE operation was successful. | |
| #define | COSE_FAILED(result) |
| Check if a COSE operation failed. | |
| #define | COSE_CHECK(call) |
| Macro for checking and propagating COSE errors. | |
Enumerations | |
| enum | cose_error_t { } |
| COSE operation error codes. More... | |
Functions | |
| const char * | cose_error_string (cose_error_t error) |
| Get a human-readable error message for a COSE error. | |
COSE library error definitions.
This header defines error codes for COSE (CBOR Object Signing and Encryption) operations as specified in RFC 8152.
Definition in file cose-error.h.
| #define COSE_CHECK | ( | call | ) |
Macro for checking and propagating COSE errors.
Usage: COSE_CHECK(some_cose_function(params));
Definition at line 121 of file cose-error.h.
| #define COSE_FAILED | ( | result | ) |
Check if a COSE operation failed.
| result | The result to check |
Definition at line 107 of file cose-error.h.
| #define COSE_SUCCESS_CHECK | ( | result | ) |
Check if a COSE operation was successful.
| result | The result to check |
Definition at line 100 of file cose-error.h.
| enum cose_error_t |
COSE operation error codes.
Error codes for COSE operations use negative values to distinguish them from success (0) and positive return values (e.g., sizes).
Definition at line 53 of file cose-error.h.
| const char * cose_error_string | ( | cose_error_t | error | ) |
Get a human-readable error message for a COSE error.
| error | The COSE error code |
Definition at line 41 of file cose-error.c.
References COSE_ERR_BUFFER_OVERFLOW, COSE_ERR_BUFFER_TOO_SMALL, COSE_ERR_CBOR_DECODING, COSE_ERR_CBOR_ENCODING, COSE_ERR_CBOR_INVALID_TYPE, COSE_ERR_CBOR_MALFORMED, COSE_ERR_CRYPTO_AUTHENTICATION, COSE_ERR_CRYPTO_DECRYPT, COSE_ERR_CRYPTO_ENCRYPT, COSE_ERR_CRYPTO_INVALID_KEY, COSE_ERR_CRYPTO_KEYGEN, COSE_ERR_CRYPTO_SIGN, COSE_ERR_CRYPTO_VERIFY, COSE_ERR_INTERNAL_ERROR, COSE_ERR_INVALID_HEADER, COSE_ERR_INVALID_LENGTH, COSE_ERR_INVALID_PARAMETER, COSE_ERR_INVALID_STRUCTURE, COSE_ERR_MEMORY_ALLOCATION, COSE_ERR_MISSING_HEADER, COSE_ERR_MISSING_PAYLOAD, COSE_ERR_NOT_IMPLEMENTED, COSE_ERR_NULL_POINTER, COSE_ERR_UNKNOWN, and COSE_ERR_UNSUPPORTED_ALGORITHM.