Loading...
Searching...
No Matches
error.h File Reference

Error definitions for the PSA Crypto API. More...

Detailed Description

Error definitions for the PSA Crypto API.

This header file is also compatible with the PSA Certified Status code API.

Author
Armin Wolf wolf..nosp@m.armi.nosp@m.n@mai.nosp@m.lbox.nosp@m..tu-d.nosp@m.resd.nosp@m.en.de
Lena Boeckmann lena..nosp@m.boec.nosp@m.kmann.nosp@m.@haw.nosp@m.-hamb.nosp@m.urg..nosp@m.de

Definition in file error.h.

#include <stdint.h>
+ Include dependency graph for error.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define PSA_SUCCESS   ((psa_status_t)0)
 Status code to indicate general success.
 
#define PSA_ERROR_PROGRAMMER_ERROR   ((psa_status_t)-129)
 Status code that indicates a programmer error in the client.
 
#define PSA_ERROR_CONNECTION_REFUSED   ((psa_status_t)-130)
 Status code that indicates that the caller is not permitted to connect to a Service.
 
#define PSA_ERROR_CONNECTION_BUSY   ((psa_status_t)-131)
 Status code that indicates that the caller cannot connect to a service.
 
#define PSA_ERROR_GENERIC_ERROR   ((psa_status_t)-132)
 Status code that indicates an error that does not correspond to any defined failure cause.
 
#define PSA_ERROR_NOT_PERMITTED   ((psa_status_t)-133)
 Status code that indicates that the requested action is denied by a policy.
 
#define PSA_ERROR_NOT_SUPPORTED   ((psa_status_t)-134)
 Status code that indicates that the requested operation or a parameter is not supported.
 
#define PSA_ERROR_INVALID_ARGUMENT   ((psa_status_t)-135)
 Status code that indicates that the parameters passed to the function are invalid.
 
#define PSA_ERROR_INVALID_HANDLE   ((psa_status_t)-136)
 Status code that indicates that a handle parameter is not valid.
 
#define PSA_ERROR_BAD_STATE   ((psa_status_t)-137)
 Status code that indicates that the requested action cannot be performed in the current state.
 
#define PSA_ERROR_BUFFER_TOO_SMALL   ((psa_status_t)-138)
 Status code that indicates that an output buffer parameter is too small.
 
#define PSA_ERROR_ALREADY_EXISTS   ((psa_status_t)-139)
 Status code that indicates that an identifier or index is already in use.
 
#define PSA_ERROR_DOES_NOT_EXIST   ((psa_status_t)-140)
 Status code that indicates that an identified resource does not exist.
 
#define PSA_ERROR_INSUFFICIENT_MEMORY   ((psa_status_t)-141)
 Status code that indicates that there is not enough runtime memory.
 
#define PSA_ERROR_INSUFFICIENT_STORAGE   ((psa_status_t)-142)
 Status code that indicates that there is not enough persistent storage.
 
#define PSA_ERROR_INSUFFICIENT_DATA   ((psa_status_t)-143)
 Status code that indicates that a data source has insufficient capacity left.
 
#define PSA_ERROR_SERVICE_FAILURE   ((psa_status_t)-144)
 Status code that indicates an error within the service.
 
#define PSA_ERROR_COMMUNICATION_FAILURE   ((psa_status_t)-145)
 Status code that indicates a communication failure between the function and another service or component.
 
#define PSA_ERROR_STORAGE_FAILURE   ((psa_status_t)-146)
 Status code that indicates a storage failure that may have led to data loss.
 
#define PSA_ERROR_HARDWARE_FAILURE   ((psa_status_t)-147)
 Status code that indicates that a hardware failure was detected.
 
#define PSA_ERROR_INSUFFICIENT_ENTROPY   ((psa_status_t)-148)
 Status code that indicates that there is not enough entropy to generate random data needed for the requested action.
 
#define PSA_ERROR_INVALID_SIGNATURE   ((psa_status_t)-149)
 Status code that indicates that a signature, MAC or hash is incorrect.
 
#define PSA_ERROR_INVALID_PADDING   ((psa_status_t)-150)
 Status code that indicates that the decrypted padding is incorrect.
 
#define PSA_ERROR_CORRUPTION_DETECTED   ((psa_status_t)-151)
 Status code that indicates that internal data has been tampered with.
 
#define PSA_ERROR_DATA_CORRUPT   ((psa_status_t)-152)
 Status code that indicates that stored data has been corrupted.
 
#define PSA_ERROR_DATA_INVALID   ((psa_status_t)-153)
 Status code that indicates that data read from storage is not valid for the implementation.
 
#define PSA_OPERATION_INCOMPLETE   ((psa_status_t)-248)
 Status code that indicates that the requested operation is interruptible, and still has work to do.
 
typedef int32_t psa_status_t
 Status code type used for all PSA Certified APIs.
 

Macro Definition Documentation

◆ PSA_ERROR_ALREADY_EXISTS

#define PSA_ERROR_ALREADY_EXISTS   ((psa_status_t)-139)

Status code that indicates that an identifier or index is already in use.

Definition at line 113 of file error.h.

◆ PSA_ERROR_BAD_STATE

#define PSA_ERROR_BAD_STATE   ((psa_status_t)-137)

Status code that indicates that the requested action cannot be performed in the current state.

Multi-part operations return this error when one of the functions is called out of sequence. We also return this error if the caller has not initialized the library by a call to psa_crypto_init().

Definition at line 100 of file error.h.

◆ PSA_ERROR_BUFFER_TOO_SMALL

#define PSA_ERROR_BUFFER_TOO_SMALL   ((psa_status_t)-138)

Status code that indicates that an output buffer parameter is too small.

Applications can call the PSA_xxx_SIZE macros listed in the function description to determine a sufficient buffer size.

Definition at line 108 of file error.h.

◆ PSA_ERROR_COMMUNICATION_FAILURE

#define PSA_ERROR_COMMUNICATION_FAILURE   ((psa_status_t)-145)

Status code that indicates a communication failure between the function and another service or component.

Definition at line 144 of file error.h.

◆ PSA_ERROR_CONNECTION_BUSY

#define PSA_ERROR_CONNECTION_BUSY   ((psa_status_t)-131)

Status code that indicates that the caller cannot connect to a service.

Definition at line 62 of file error.h.

◆ PSA_ERROR_CONNECTION_REFUSED

#define PSA_ERROR_CONNECTION_REFUSED   ((psa_status_t)-130)

Status code that indicates that the caller is not permitted to connect to a Service.

Definition at line 57 of file error.h.

◆ PSA_ERROR_CORRUPTION_DETECTED

#define PSA_ERROR_CORRUPTION_DETECTED   ((psa_status_t)-151)

Status code that indicates that internal data has been tampered with.

This error code is intended as a last resort when a security breach is detected and it is unsure whether the keystore data is still protected. Only return this error code to report an alarm from a tampering detector, to indicate that the confidentiality of stored data can no longer be guaranteed, or to indicate that the integrity of previously returned data is now considered compromised.

Definition at line 185 of file error.h.

◆ PSA_ERROR_DATA_CORRUPT

#define PSA_ERROR_DATA_CORRUPT   ((psa_status_t)-152)

Status code that indicates that stored data has been corrupted.

When a storage failure occurs, it is no longer possible to ensure the global integrity of the keystore. Depending on the global integrity guarantees, access to other data might fail even if the data is still readable but its integrity cannot be guaranteed.

Definition at line 194 of file error.h.

◆ PSA_ERROR_DATA_INVALID

#define PSA_ERROR_DATA_INVALID   ((psa_status_t)-153)

Status code that indicates that data read from storage is not valid for the implementation.

Definition at line 200 of file error.h.

◆ PSA_ERROR_DOES_NOT_EXIST

#define PSA_ERROR_DOES_NOT_EXIST   ((psa_status_t)-140)

Status code that indicates that an identified resource does not exist.

Definition at line 118 of file error.h.

◆ PSA_ERROR_GENERIC_ERROR

#define PSA_ERROR_GENERIC_ERROR   ((psa_status_t)-132)

Status code that indicates an error that does not correspond to any defined failure cause.

Definition at line 68 of file error.h.

◆ PSA_ERROR_HARDWARE_FAILURE

#define PSA_ERROR_HARDWARE_FAILURE   ((psa_status_t)-147)

Status code that indicates that a hardware failure was detected.

Definition at line 158 of file error.h.

◆ PSA_ERROR_INSUFFICIENT_DATA

#define PSA_ERROR_INSUFFICIENT_DATA   ((psa_status_t)-143)

Status code that indicates that a data source has insufficient capacity left.

Definition at line 133 of file error.h.

◆ PSA_ERROR_INSUFFICIENT_ENTROPY

#define PSA_ERROR_INSUFFICIENT_ENTROPY   ((psa_status_t)-148)

Status code that indicates that there is not enough entropy to generate random data needed for the requested action.

Definition at line 164 of file error.h.

◆ PSA_ERROR_INSUFFICIENT_MEMORY

#define PSA_ERROR_INSUFFICIENT_MEMORY   ((psa_status_t)-141)

Status code that indicates that there is not enough runtime memory.

Definition at line 123 of file error.h.

◆ PSA_ERROR_INSUFFICIENT_STORAGE

#define PSA_ERROR_INSUFFICIENT_STORAGE   ((psa_status_t)-142)

Status code that indicates that there is not enough persistent storage.

Definition at line 128 of file error.h.

◆ PSA_ERROR_INVALID_ARGUMENT

#define PSA_ERROR_INVALID_ARGUMENT   ((psa_status_t)-135)

Status code that indicates that the parameters passed to the function are invalid.

Definition at line 83 of file error.h.

◆ PSA_ERROR_INVALID_HANDLE

#define PSA_ERROR_INVALID_HANDLE   ((psa_status_t)-136)

Status code that indicates that a handle parameter is not valid.

Usually means that a key identifier does not refer to an existing key.

Definition at line 90 of file error.h.

◆ PSA_ERROR_INVALID_PADDING

#define PSA_ERROR_INVALID_PADDING   ((psa_status_t)-150)

Status code that indicates that the decrypted padding is incorrect.

Definition at line 174 of file error.h.

◆ PSA_ERROR_INVALID_SIGNATURE

#define PSA_ERROR_INVALID_SIGNATURE   ((psa_status_t)-149)

Status code that indicates that a signature, MAC or hash is incorrect.

Definition at line 169 of file error.h.

◆ PSA_ERROR_NOT_PERMITTED

#define PSA_ERROR_NOT_PERMITTED   ((psa_status_t)-133)

Status code that indicates that the requested action is denied by a policy.

Definition at line 73 of file error.h.

◆ PSA_ERROR_NOT_SUPPORTED

#define PSA_ERROR_NOT_SUPPORTED   ((psa_status_t)-134)

Status code that indicates that the requested operation or a parameter is not supported.

Definition at line 78 of file error.h.

◆ PSA_ERROR_PROGRAMMER_ERROR

#define PSA_ERROR_PROGRAMMER_ERROR   ((psa_status_t)-129)

Status code that indicates a programmer error in the client.

Definition at line 52 of file error.h.

◆ PSA_ERROR_SERVICE_FAILURE

#define PSA_ERROR_SERVICE_FAILURE   ((psa_status_t)-144)

Status code that indicates an error within the service.

Definition at line 138 of file error.h.

◆ PSA_ERROR_STORAGE_FAILURE

#define PSA_ERROR_STORAGE_FAILURE   ((psa_status_t)-146)

Status code that indicates a storage failure that may have led to data loss.

When a storage failure occurs, it is no longer possible to ensure the global integrity of the keystore. Access to other data might fail even if the data is still readable but its integrity cannot be guaranteed.

Definition at line 153 of file error.h.

◆ PSA_OPERATION_INCOMPLETE

#define PSA_OPERATION_INCOMPLETE   ((psa_status_t)-248)

Status code that indicates that the requested operation is interruptible, and still has work to do.

This status code does not mean that the operation has failed or that it has succeeded. The operation must be repeated until it completes with either success or failure.

Definition at line 209 of file error.h.

◆ PSA_SUCCESS

#define PSA_SUCCESS   ((psa_status_t)0)

Status code to indicate general success.

Definition at line 47 of file error.h.

Typedef Documentation

◆ psa_status_t

typedef int32_t psa_status_t

Status code type used for all PSA Certified APIs.

This is either PSA_SUCCESS, which is zero, indicating success; or a small negative value indicating that an error occurred. Errors are encoded as one of the PSA_ERROR_xxx values defined here.

Definition at line 41 of file error.h.