mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
Ensure that operation is put into error state if error occurs
If an error occurs, calling any function on the same operation should return PSA_ERROR_BAD_STATE, and we were not honouring that for all errors. Add extra failure tests to try and ratify this. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
@@ -505,10 +505,12 @@ struct psa_sign_hash_interruptible_operation_s {
|
||||
|
||||
psa_driver_sign_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx);
|
||||
|
||||
unsigned int MBEDTLS_PRIVATE(error_occurred) : 1;
|
||||
|
||||
uint32_t MBEDTLS_PRIVATE(num_ops);
|
||||
};
|
||||
|
||||
#define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0 }
|
||||
#define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0, 0 }
|
||||
|
||||
static inline struct psa_sign_hash_interruptible_operation_s
|
||||
psa_sign_hash_interruptible_operation_init(void)
|
||||
@@ -533,10 +535,12 @@ struct psa_verify_hash_interruptible_operation_s {
|
||||
|
||||
psa_driver_verify_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx);
|
||||
|
||||
unsigned int MBEDTLS_PRIVATE(error_occurred) : 1;
|
||||
|
||||
uint32_t MBEDTLS_PRIVATE(num_ops);
|
||||
};
|
||||
|
||||
#define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0 }
|
||||
#define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0, 0 }
|
||||
|
||||
static inline struct psa_verify_hash_interruptible_operation_s
|
||||
psa_verify_hash_interruptible_operation_init(void)
|
||||
|
Reference in New Issue
Block a user