Add missing resource cleanup on test failure

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2024-11-20 11:55:41 +01:00
parent eafc2751e6
commit 27c604af08

View File

@ -223,12 +223,9 @@ void sign_fail(int key_type_arg, data_t *key_data,
size_t length = SIZE_MAX;
psa_sign_hash_interruptible_operation_t sign_operation =
psa_sign_hash_interruptible_operation_init();
psa_verify_hash_interruptible_operation_t verify_operation =
psa_verify_hash_interruptible_operation_init();
PSA_INIT();
psa_set_key_type(&attributes, key_type);
@ -277,6 +274,8 @@ void sign_fail(int key_type_arg, data_t *key_data,
}
exit:
psa_sign_hash_abort(&sign_operation);
psa_verify_hash_abort(&verify_operation);
psa_destroy_key(key_id);
psa_reset_key_attributes(&attributes);
PSA_DONE();