Add interruptible to psa_op_fail tests
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
9100797cb3
commit
4cec2f60dc
1 changed files with 25 additions and 0 deletions
|
@ -221,6 +221,13 @@ void sign_fail(int key_type_arg, data_t *key_data,
|
||||||
uint8_t input[1] = { 'A' };
|
uint8_t input[1] = { 'A' };
|
||||||
uint8_t output[PSA_SIGNATURE_MAX_SIZE] = { 0 };
|
uint8_t output[PSA_SIGNATURE_MAX_SIZE] = { 0 };
|
||||||
size_t length = SIZE_MAX;
|
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_INIT();
|
||||||
|
|
||||||
|
@ -237,6 +244,15 @@ void sign_fail(int key_type_arg, data_t *key_data,
|
||||||
psa_sign_hash(key_id, alg,
|
psa_sign_hash(key_id, alg,
|
||||||
input, sizeof(input),
|
input, sizeof(input),
|
||||||
output, sizeof(output), &length));
|
output, sizeof(output), &length));
|
||||||
|
|
||||||
|
if (PSA_KEY_TYPE_IS_ECC(key_type)) {
|
||||||
|
TEST_STATUS(expected_status,
|
||||||
|
psa_sign_hash_start(&sign_operation, key_id, alg,
|
||||||
|
input, sizeof(input)));
|
||||||
|
|
||||||
|
PSA_ASSERT(psa_sign_hash_abort(&sign_operation));
|
||||||
|
}
|
||||||
|
|
||||||
if (!private_only) {
|
if (!private_only) {
|
||||||
/* Determine a plausible signature size to avoid an INVALID_SIGNATURE
|
/* Determine a plausible signature size to avoid an INVALID_SIGNATURE
|
||||||
* error based on this. */
|
* error based on this. */
|
||||||
|
@ -253,6 +269,15 @@ void sign_fail(int key_type_arg, data_t *key_data,
|
||||||
psa_verify_hash(key_id, alg,
|
psa_verify_hash(key_id, alg,
|
||||||
input, sizeof(input),
|
input, sizeof(input),
|
||||||
output, output_length));
|
output, output_length));
|
||||||
|
|
||||||
|
if (PSA_KEY_TYPE_IS_ECC(key_type)) {
|
||||||
|
TEST_STATUS(expected_status,
|
||||||
|
psa_verify_hash_start(&verify_operation, key_id, alg,
|
||||||
|
input, sizeof(input),
|
||||||
|
output, output_length));
|
||||||
|
|
||||||
|
PSA_ASSERT(psa_verify_hash_abort(&verify_operation));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
Loading…
Reference in a new issue