Lines Matching refs:status
50 psa_status_t status = psa_get_key_attributes(key, &attributes); in check_key_attributes_sanity() local
51 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in check_key_attributes_sanity()
56 PSA_ASSERT(status); in check_key_attributes_sanity()
79 status = psa_get_key_slot_number(&attributes, &slot_number); in check_key_attributes_sanity()
84 TEST_EQUAL(status, 0); in check_key_attributes_sanity()
87 TEST_EQUAL(status, PSA_ERROR_INVALID_ARGUMENT); in check_key_attributes_sanity()
129 psa_status_t status = PSA_SUCCESS; in exercise_mac_key() local
136 status = psa_mac_sign_setup(&operation, key, alg); in exercise_mac_key()
137 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_mac_key()
142 PSA_ASSERT(status); in exercise_mac_key()
155 status = psa_mac_verify_setup(&operation, key, alg); in exercise_mac_key()
156 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_mac_key()
161 PSA_ASSERT(status); in exercise_mac_key()
190 psa_status_t status = PSA_SUCCESS; in exercise_cipher_key() local
197 status = psa_cipher_encrypt_setup(&operation, key, alg); in exercise_cipher_key()
198 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_cipher_key()
203 PSA_ASSERT(status); in exercise_cipher_key()
225 status = psa_cipher_decrypt_setup(&operation, key, alg); in exercise_cipher_key()
226 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_cipher_key()
231 PSA_ASSERT(status); in exercise_cipher_key()
240 status = psa_cipher_finish(&operation, in exercise_cipher_key()
248 TEST_ASSERT(status == PSA_SUCCESS || in exercise_cipher_key()
249 status == PSA_ERROR_INVALID_PADDING); in exercise_cipher_key()
251 PSA_ASSERT(status); in exercise_cipher_key()
276 psa_status_t status = PSA_SUCCESS; in exercise_aead_key() local
288 status = psa_aead_encrypt(key, alg, in exercise_aead_key()
294 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_aead_key()
298 PSA_ASSERT(status); in exercise_aead_key()
306 status = psa_aead_decrypt(key, alg, in exercise_aead_key()
312 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_aead_key()
316 TEST_ASSERT(status == verify_status); in exercise_aead_key()
355 psa_status_t status = PSA_SUCCESS; in exercise_signature_key() local
372 status = psa_sign_hash(key, alg, in exercise_signature_key()
376 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_signature_key()
380 PSA_ASSERT(status); in exercise_signature_key()
388 status = psa_verify_hash(key, alg, in exercise_signature_key()
391 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_signature_key()
395 TEST_ASSERT(status == verify_status); in exercise_signature_key()
406 status = psa_sign_message(key, alg, in exercise_signature_key()
410 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_signature_key()
414 PSA_ASSERT(status); in exercise_signature_key()
422 status = psa_verify_message(key, alg, in exercise_signature_key()
425 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_signature_key()
429 TEST_ASSERT(status == verify_status); in exercise_signature_key()
450 psa_status_t status = PSA_SUCCESS; in exercise_asymmetric_encryption_key() local
452 status = psa_asymmetric_encrypt(key, alg, in exercise_asymmetric_encryption_key()
457 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_asymmetric_encryption_key()
461 PSA_ASSERT(status); in exercise_asymmetric_encryption_key()
465 status = psa_asymmetric_decrypt(key, alg, in exercise_asymmetric_encryption_key()
470 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_asymmetric_encryption_key()
474 TEST_ASSERT(status == PSA_SUCCESS || in exercise_asymmetric_encryption_key()
476 (status == PSA_ERROR_INVALID_ARGUMENT || in exercise_asymmetric_encryption_key()
477 status == PSA_ERROR_INVALID_PADDING))); in exercise_asymmetric_encryption_key()
495 psa_status_t status = PSA_SUCCESS; in mbedtls_test_psa_setup_key_derivation_wrap() local
500 status = psa_key_derivation_input_key(operation, in mbedtls_test_psa_setup_key_derivation_wrap()
503 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_setup_key_derivation_wrap()
507 PSA_ASSERT(status); in mbedtls_test_psa_setup_key_derivation_wrap()
516 status = psa_key_derivation_input_key(operation, in mbedtls_test_psa_setup_key_derivation_wrap()
519 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_setup_key_derivation_wrap()
523 PSA_ASSERT(status); in mbedtls_test_psa_setup_key_derivation_wrap()
525 status = psa_key_derivation_input_key(operation, in mbedtls_test_psa_setup_key_derivation_wrap()
528 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_setup_key_derivation_wrap()
532 PSA_ASSERT(status); in mbedtls_test_psa_setup_key_derivation_wrap()
542 status = psa_key_derivation_input_key(operation, in mbedtls_test_psa_setup_key_derivation_wrap()
545 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_setup_key_derivation_wrap()
549 PSA_ASSERT(status); in mbedtls_test_psa_setup_key_derivation_wrap()
561 status = psa_key_derivation_input_key(operation, in mbedtls_test_psa_setup_key_derivation_wrap()
564 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_setup_key_derivation_wrap()
568 PSA_ASSERT(status); in mbedtls_test_psa_setup_key_derivation_wrap()
609 psa_status_t status = psa_key_derivation_output_bytes(&operation, in exercise_key_derivation_key() local
612 if (key_destroyable && status == PSA_ERROR_BAD_STATE) { in exercise_key_derivation_key()
616 PSA_ASSERT(status); in exercise_key_derivation_key()
640 psa_status_t status = psa_get_key_attributes(key, &attributes); in mbedtls_test_psa_key_agreement_with_self() local
641 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_key_agreement_with_self()
646 PSA_ASSERT(status); in mbedtls_test_psa_key_agreement_with_self()
653 status = psa_export_public_key(key, public_key, public_key_length, in mbedtls_test_psa_key_agreement_with_self()
655 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_key_agreement_with_self()
657 status = PSA_SUCCESS; in mbedtls_test_psa_key_agreement_with_self()
660 PSA_ASSERT(status); in mbedtls_test_psa_key_agreement_with_self()
662 status = psa_key_derivation_key_agreement( in mbedtls_test_psa_key_agreement_with_self()
665 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_key_agreement_with_self()
667 status = PSA_SUCCESS; in mbedtls_test_psa_key_agreement_with_self()
678 return status; in mbedtls_test_psa_key_agreement_with_self()
697 psa_status_t status = psa_get_key_attributes(key, &attributes); in mbedtls_test_psa_raw_key_agreement_with_self() local
698 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_raw_key_agreement_with_self()
703 PSA_ASSERT(status); in mbedtls_test_psa_raw_key_agreement_with_self()
710 status = psa_export_public_key(key, in mbedtls_test_psa_raw_key_agreement_with_self()
713 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_raw_key_agreement_with_self()
715 status = PSA_SUCCESS; in mbedtls_test_psa_raw_key_agreement_with_self()
718 PSA_ASSERT(status); in mbedtls_test_psa_raw_key_agreement_with_self()
720 status = psa_raw_key_agreement(alg, key, in mbedtls_test_psa_raw_key_agreement_with_self()
723 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in mbedtls_test_psa_raw_key_agreement_with_self()
725 status = PSA_SUCCESS; in mbedtls_test_psa_raw_key_agreement_with_self()
728 if (status == PSA_SUCCESS) { in mbedtls_test_psa_raw_key_agreement_with_self()
744 return status; in mbedtls_test_psa_raw_key_agreement_with_self()
800 psa_status_t status = psa_get_key_attributes(key, &attributes); in exercise_key_agreement_key() local
801 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_key_agreement_key()
805 PSA_ASSERT(status); in exercise_key_agreement_key()
1015 psa_status_t status = psa_get_key_attributes(key, &attributes); in exercise_export_key() local
1016 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_export_key()
1021 PSA_ASSERT(status); in exercise_export_key()
1028 status = psa_export_key(key, exported, exported_size, &exported_length); in exercise_export_key()
1029 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_export_key()
1035 TEST_EQUAL(status, PSA_ERROR_NOT_PERMITTED); in exercise_export_key()
1039 PSA_ASSERT(status); in exercise_export_key()
1065 psa_status_t status = psa_get_key_attributes(key, &attributes); in exercise_export_public_key() local
1066 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_export_public_key()
1071 PSA_ASSERT(status); in exercise_export_public_key()
1078 status = psa_export_public_key(key, exported, in exercise_export_public_key()
1080 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_export_public_key()
1085 TEST_EQUAL(status, PSA_ERROR_INVALID_ARGUMENT); in exercise_export_public_key()
1096 status = psa_export_public_key(key, exported, in exercise_export_public_key()
1098 if (key_destroyable && status == PSA_ERROR_INVALID_HANDLE) { in exercise_export_public_key()
1103 PSA_ASSERT(status); in exercise_export_public_key()