Home
last modified time | relevance | path

Searched refs:status (Results 1 – 25 of 127) sorted by relevance

123456

/mbedtls-3.6.0/library/
Dpsa_crypto.c397 static void psa_wipe_tag_output_buffer(uint8_t *output_buffer, psa_status_t status, in psa_wipe_tag_output_buffer() argument
408 if (status == PSA_SUCCESS) { in psa_wipe_tag_output_buffer()
532 psa_status_t status = psa_allocate_buffer_to_slot(slot, in psa_copy_key_material_into_slot() local
534 if (status != PSA_SUCCESS) { in psa_copy_key_material_into_slot()
535 return status; in psa_copy_key_material_into_slot()
548 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_import_key_into_slot() local
559 status = psa_validate_unstructured_key_bit_size(attributes->core.type, in psa_import_key_into_slot()
561 if (status != PSA_SUCCESS) { in psa_import_key_into_slot()
562 return status; in psa_import_key_into_slot()
898 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_get_and_lock_key_slot_with_policy() local
[all …]
Dpsa_crypto_slot_management.c86 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_get_and_lock_key_slot_in_memory() local
102 status = mbedtls_svc_key_id_equal(key, slot->attr.id) ? in psa_get_and_lock_key_slot_in_memory()
115 status = (slot_idx < MBEDTLS_PSA_KEY_SLOT_COUNT) ? in psa_get_and_lock_key_slot_in_memory()
119 if (status == PSA_SUCCESS) { in psa_get_and_lock_key_slot_in_memory()
120 status = psa_lock_key_slot(slot); in psa_get_and_lock_key_slot_in_memory()
121 if (status == PSA_SUCCESS) { in psa_get_and_lock_key_slot_in_memory()
126 return status; in psa_get_and_lock_key_slot_in_memory()
153 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_get_empty_key_slot() local
158 status = PSA_ERROR_BAD_STATE; in psa_get_empty_key_slot()
192 status = psa_lock_key_slot(selected_slot); in psa_get_empty_key_slot()
[all …]
Dpsa_crypto_driver_wrappers.h103 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_driver_wrapper_init() local
106 status = tfm_builtin_key_loader_init(); in psa_driver_wrapper_init()
107 if (status != PSA_SUCCESS) in psa_driver_wrapper_init()
108 return ( status ); in psa_driver_wrapper_init()
112 status = psa_init_all_se_drivers( ); in psa_driver_wrapper_init()
113 if( status != PSA_SUCCESS ) in psa_driver_wrapper_init()
114 return( status ); in psa_driver_wrapper_init()
118 status = mbedtls_test_transparent_init( ); in psa_driver_wrapper_init()
119 if( status != PSA_SUCCESS ) in psa_driver_wrapper_init()
120 return( status ); in psa_driver_wrapper_init()
[all …]
Dpsa_crypto_ecp.c41 psa_status_t status; in mbedtls_psa_ecp_load_representation() local
95 status = PSA_ERROR_NOT_SUPPORTED; in mbedtls_psa_ecp_load_representation()
99 status = mbedtls_to_psa_error( in mbedtls_psa_ecp_load_representation()
101 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation()
108 status = mbedtls_to_psa_error( in mbedtls_psa_ecp_load_representation()
112 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation()
117 status = mbedtls_to_psa_error( in mbedtls_psa_ecp_load_representation()
119 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation()
124 status = mbedtls_to_psa_error( in mbedtls_psa_ecp_load_representation()
129 if (status != PSA_SUCCESS) { in mbedtls_psa_ecp_load_representation()
[all …]
Dpsa_crypto_rsa.c47 psa_status_t status; in psa_check_rsa_key_byte_aligned() local
49 status = mbedtls_to_psa_error( in psa_check_rsa_key_byte_aligned()
51 if (status == PSA_SUCCESS) { in psa_check_rsa_key_byte_aligned()
53 status = PSA_ERROR_NOT_SUPPORTED; in psa_check_rsa_key_byte_aligned()
57 return status; in psa_check_rsa_key_byte_aligned()
64 psa_status_t status; in mbedtls_psa_rsa_load_representation() local
71 status = mbedtls_to_psa_error( in mbedtls_psa_rsa_load_representation()
75 status = mbedtls_to_psa_error( in mbedtls_psa_rsa_load_representation()
78 if (status != PSA_SUCCESS) { in mbedtls_psa_rsa_load_representation()
85 status = PSA_ERROR_INVALID_ARGUMENT; in mbedtls_psa_rsa_load_representation()
[all …]
Dpsa_crypto_storage.c79 psa_status_t status; in psa_crypto_storage_load() local
84 status = psa_its_get_info(data_identifier, &data_identifier_info); in psa_crypto_storage_load()
85 if (status != PSA_SUCCESS) { in psa_crypto_storage_load()
86 return status; in psa_crypto_storage_load()
89 status = psa_its_get(data_identifier, 0, (uint32_t) data_size, data, &data_length); in psa_crypto_storage_load()
94 return status; in psa_crypto_storage_load()
132 psa_status_t status; in psa_crypto_storage_store() local
140 status = psa_its_set(data_identifier, (uint32_t) data_length, data, 0); in psa_crypto_storage_store()
141 if (status != PSA_SUCCESS) { in psa_crypto_storage_store()
145 status = psa_its_get_info(data_identifier, &data_identifier_info); in psa_crypto_storage_store()
[all …]
Dpsa_crypto_aead.c33 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_aead_setup() local
61 status = mbedtls_to_psa_error( in psa_aead_setup()
64 if (status != PSA_SUCCESS) { in psa_aead_setup()
65 return status; in psa_aead_setup()
81 status = mbedtls_to_psa_error( in psa_aead_setup()
84 if (status != PSA_SUCCESS) { in psa_aead_setup()
85 return status; in psa_aead_setup()
99 status = mbedtls_to_psa_error( in psa_aead_setup()
102 if (status != PSA_SUCCESS) { in psa_aead_setup()
103 return status; in psa_aead_setup()
[all …]
Dpsa_crypto_mac.c41 psa_status_t status; in psa_hmac_setup_internal() local
62 status = psa_hash_compute(hash_alg, key, key_length, in psa_hmac_setup_internal()
64 if (status != PSA_SUCCESS) { in psa_hmac_setup_internal()
90 status = psa_hash_setup(&hmac->hash_ctx, hash_alg); in psa_hmac_setup_internal()
91 if (status != PSA_SUCCESS) { in psa_hmac_setup_internal()
95 status = psa_hash_update(&hmac->hash_ctx, ipad, block_size); in psa_hmac_setup_internal()
100 return status; in psa_hmac_setup_internal()
120 psa_status_t status; in psa_hmac_finish_internal() local
122 status = psa_hash_finish(&hmac->hash_ctx, tmp, sizeof(tmp), &hash_size); in psa_hmac_finish_internal()
123 if (status != PSA_SUCCESS) { in psa_hmac_finish_internal()
[all …]
Dlmots.c38 static int local_err_translation(psa_status_t status) in local_err_translation() argument
40 return psa_status_to_mbedtls(status, psa_to_lms_errors, in local_err_translation()
44 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument
149 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in create_digit_array_with_checksum() local
153 status = psa_hash_setup(&op, PSA_ALG_SHA_256); in create_digit_array_with_checksum()
154 if (status != PSA_SUCCESS) { in create_digit_array_with_checksum()
158 status = psa_hash_update(&op, params->I_key_identifier, in create_digit_array_with_checksum()
160 if (status != PSA_SUCCESS) { in create_digit_array_with_checksum()
164 status = psa_hash_update(&op, params->q_leaf_identifier, in create_digit_array_with_checksum()
166 if (status != PSA_SUCCESS) { in create_digit_array_with_checksum()
[all …]
Dssl_cookie.c30 static int local_err_translation(psa_status_t status) in local_err_translation() argument
32 return psa_status_to_mbedtls(status, psa_to_ssl_errors, in local_err_translation()
36 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument
106 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_cookie_setup() local
126 if ((status = psa_generate_key(&attributes, in mbedtls_ssl_cookie_setup()
128 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_ssl_cookie_setup()
191 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_cookie_write() local
214 status = psa_mac_sign_setup(&operation, ctx->psa_hmac_key, in mbedtls_ssl_cookie_write()
216 if (status != PSA_SUCCESS) { in mbedtls_ssl_cookie_write()
217 ret = PSA_TO_MBEDTLS_ERR(status); in mbedtls_ssl_cookie_write()
[all …]
Dpsa_crypto_cipher.c296 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in psa_cipher_update_ecb() local
302 status = PSA_SUCCESS; in psa_cipher_update_ecb()
321 status = mbedtls_to_psa_error( in psa_cipher_update_ecb()
327 if (status != PSA_SUCCESS) { in psa_cipher_update_ecb()
339 status = mbedtls_to_psa_error( in psa_cipher_update_ecb()
344 if (status != PSA_SUCCESS) { in psa_cipher_update_ecb()
362 status = PSA_SUCCESS; in psa_cipher_update_ecb()
365 return status; in psa_cipher_update_ecb()
374 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_psa_cipher_update() local
398 status = psa_cipher_update_ecb(&operation->ctx.cipher, in mbedtls_psa_cipher_update()
[all …]
Dpsa_crypto_pake.c158 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_psa_pake_setup() local
164 status = psa_crypto_driver_pake_get_password_len(inputs, &password_len); in mbedtls_psa_pake_setup()
165 if (status != PSA_SUCCESS) { in mbedtls_psa_pake_setup()
166 return status; in mbedtls_psa_pake_setup()
169 status = psa_crypto_driver_pake_get_user_len(inputs, &user_len); in mbedtls_psa_pake_setup()
170 if (status != PSA_SUCCESS) { in mbedtls_psa_pake_setup()
171 return status; in mbedtls_psa_pake_setup()
174 status = psa_crypto_driver_pake_get_peer_len(inputs, &peer_len); in mbedtls_psa_pake_setup()
175 if (status != PSA_SUCCESS) { in mbedtls_psa_pake_setup()
176 return status; in mbedtls_psa_pake_setup()
[all …]
Dpsa_crypto_se.c128 psa_status_t status; in psa_load_se_persistent_data() local
132 status = psa_get_se_driver_its_file_uid(driver, &uid); in psa_load_se_persistent_data()
133 if (status != PSA_SUCCESS) { in psa_load_se_persistent_data()
134 return status; in psa_load_se_persistent_data()
153 psa_status_t status; in psa_save_se_persistent_data() local
156 status = psa_get_se_driver_its_file_uid(driver, &uid); in psa_save_se_persistent_data()
157 if (status != PSA_SUCCESS) { in psa_save_se_persistent_data()
158 return status; in psa_save_se_persistent_data()
186 psa_status_t status; in psa_find_se_slot_for_key() local
210 status = p_validate_slot_number(&driver->u.context, in psa_find_se_slot_for_key()
[all …]
Dpk_wrap.c54 int mbedtls_pk_error_from_psa(psa_status_t status) in mbedtls_pk_error_from_psa() argument
56 switch (status) { in mbedtls_pk_error_from_psa()
89 int mbedtls_pk_error_from_psa_rsa(psa_status_t status) in mbedtls_pk_error_from_psa_rsa() argument
91 switch (status) { in mbedtls_pk_error_from_psa_rsa()
130 int mbedtls_pk_error_from_psa_ecdsa(psa_status_t status) in mbedtls_pk_error_from_psa_ecdsa() argument
132 switch (status) { in mbedtls_pk_error_from_psa_ecdsa()
191 psa_status_t status; in rsa_verify_wrap() local
220 status = psa_import_key(&attributes, in rsa_verify_wrap()
223 if (status != PSA_SUCCESS) { in rsa_verify_wrap()
224 ret = PSA_PK_TO_MBEDTLS_ERR(status); in rsa_verify_wrap()
[all …]
Dssl_tls13_keys.c41 static int local_err_translation(psa_status_t status) in local_err_translation() argument
43 return psa_status_to_mbedtls(status, psa_to_ssl_errors, in local_err_translation()
47 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument
161 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_tls13_hkdf_expand_label() local
193 status = psa_key_derivation_setup(&operation, PSA_ALG_HKDF_EXPAND(hash_alg)); in mbedtls_ssl_tls13_hkdf_expand_label()
195 if (status != PSA_SUCCESS) { in mbedtls_ssl_tls13_hkdf_expand_label()
199 status = psa_key_derivation_input_bytes(&operation, in mbedtls_ssl_tls13_hkdf_expand_label()
204 if (status != PSA_SUCCESS) { in mbedtls_ssl_tls13_hkdf_expand_label()
208 status = psa_key_derivation_input_bytes(&operation, in mbedtls_ssl_tls13_hkdf_expand_label()
213 if (status != PSA_SUCCESS) { in mbedtls_ssl_tls13_hkdf_expand_label()
[all …]
Dpsa_its_file.c115 psa_status_t status; in psa_its_get_info() local
117 status = psa_its_read_file(uid, p_info, &stream); in psa_its_get_info()
121 return status; in psa_its_get_info()
130 psa_status_t status; in psa_its_get() local
135 status = psa_its_read_file(uid, &info, &stream); in psa_its_get()
136 if (status != PSA_SUCCESS) { in psa_its_get()
139 status = PSA_ERROR_INVALID_ARGUMENT; in psa_its_get()
152 status = PSA_ERROR_STORAGE_FAILURE; in psa_its_get()
168 status = PSA_SUCCESS; in psa_its_get()
177 return status; in psa_its_get()
[all …]
Dlms.c39 static int local_err_translation(psa_status_t status) in local_err_translation() argument
41 return psa_status_to_mbedtls(status, psa_to_lms_errors, in local_err_translation()
45 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument
99 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in create_merkle_leaf_value() local
104 status = psa_hash_setup(&op, PSA_ALG_SHA_256); in create_merkle_leaf_value()
105 if (status != PSA_SUCCESS) { in create_merkle_leaf_value()
109 status = psa_hash_update(&op, params->I_key_identifier, in create_merkle_leaf_value()
111 if (status != PSA_SUCCESS) { in create_merkle_leaf_value()
116 status = psa_hash_update(&op, r_node_idx_bytes, 4); in create_merkle_leaf_value()
117 if (status != PSA_SUCCESS) { in create_merkle_leaf_value()
[all …]
Dpsa_crypto_ffdh.c126 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_psa_ffdh_export_public_key() local
146 status = mbedtls_psa_ffdh_set_prime_generator(key_len, &P, &G); in mbedtls_psa_ffdh_export_public_key()
148 if (status != PSA_SUCCESS) { in mbedtls_psa_ffdh_export_public_key()
165 if (status == PSA_SUCCESS && ret != 0) { in mbedtls_psa_ffdh_export_public_key()
166 status = mbedtls_to_psa_error(ret); in mbedtls_psa_ffdh_export_public_key()
169 return status; in mbedtls_psa_ffdh_export_public_key()
181 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_psa_ffdh_generate_key() local
185 status = mbedtls_psa_ffdh_set_prime_generator(key_buffer_size, &P, NULL); in mbedtls_psa_ffdh_generate_key()
187 if (status != PSA_SUCCESS) { in mbedtls_psa_ffdh_generate_key()
202 if (status == PSA_SUCCESS && ret != 0) { in mbedtls_psa_ffdh_generate_key()
[all …]
/mbedtls-3.6.0/programs/psa/
Dcrypto_examples.c57 psa_status_t status; in cipher_operation() local
66 status = psa_cipher_update(operation, input + bytes_written, in cipher_operation()
69 ASSERT_STATUS(status, PSA_SUCCESS); in cipher_operation()
75 status = psa_cipher_finish(operation, output + *output_len, in cipher_operation()
77 ASSERT_STATUS(status, PSA_SUCCESS); in cipher_operation()
81 return status; in cipher_operation()
95 psa_status_t status; in cipher_encrypt() local
100 status = psa_cipher_encrypt_setup(&operation, key, alg); in cipher_encrypt()
101 ASSERT_STATUS(status, PSA_SUCCESS); in cipher_encrypt()
103 status = psa_cipher_generate_iv(&operation, iv, iv_size, &iv_len); in cipher_encrypt()
[all …]
Dkey_ladder_demo.c77 status = DEMO_ERROR; \
87 status = (expr); \
88 if (status != PSA_SUCCESS) \
91 (int) status, \
158 psa_status_t status = PSA_SUCCESS; in save_key() local
177 return status; in save_key()
187 psa_status_t status = PSA_SUCCESS; in generate() local
203 return status; in generate()
216 psa_status_t status = PSA_SUCCESS; in import_key_from_file() local
231 status = DEMO_ERROR; in import_key_from_file()
[all …]
Dhmac_demo.c77 status = (expr); \
78 if (status != PSA_SUCCESS) \
81 (int) status, \
95 psa_status_t status; in hmac_demo() local
110 status = psa_import_key(&attributes, in hmac_demo()
112 if (status != PSA_SUCCESS) { in hmac_demo()
113 return status; in hmac_demo()
139 return status; in hmac_demo()
144 psa_status_t status = PSA_SUCCESS; in main() local
156 return status == PSA_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE; in main()
/mbedtls-3.6.0/scripts/data_files/driver_templates/
Dpsa_crypto_driver_wrappers.h.jinja75 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
78 status = psa_init_all_se_drivers( );
79 if( status != PSA_SUCCESS )
80 return( status );
84 status = mbedtls_test_transparent_init( );
85 if( status != PSA_SUCCESS )
86 return( status );
88 status = mbedtls_test_opaque_init( );
89 if( status != PSA_SUCCESS )
90 return( status );
[all …]
/mbedtls-3.6.0/tests/suites/
Dtest_suite_psa_crypto_entropy.function43 psa_status_t status = psa_its_get_info(PSA_CRYPTO_ITS_RANDOM_SEED_UID,
47 TEST_EQUAL(status, PSA_ERROR_DOES_NOT_EXIST);
49 TEST_EQUAL(status, PSA_SUCCESS);
155 psa_status_t status;
171 status = remove_seed_file();
172 TEST_ASSERT((status == PSA_SUCCESS) ||
173 (status == PSA_ERROR_DOES_NOT_EXIST));
178 status = mbedtls_psa_inject_entropy(seed, seed_length_a);
179 TEST_EQUAL(status, expected_status_a);
185 status = mbedtls_psa_inject_entropy(seed, seed_length_b);
[all …]
/mbedtls-3.6.0/tests/src/drivers/
Dtest_driver_key_management.c57 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_test_transparent_init() local
60 status = libtestdriver1_psa_crypto_init(); in mbedtls_test_transparent_init()
61 if (status != PSA_SUCCESS) { in mbedtls_test_transparent_init()
62 return status; in mbedtls_test_transparent_init()
66 (void) status; in mbedtls_test_transparent_init()
352 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_test_opaque_import_key() local
373 status = psa_validate_unstructured_key_bit_size(type, in mbedtls_test_opaque_import_key()
375 if (status != PSA_SUCCESS) { in mbedtls_test_opaque_import_key()
390 status = libtestdriver1_mbedtls_psa_ecp_import_key( in mbedtls_test_opaque_import_key()
397 status = mbedtls_psa_ecp_import_key( in mbedtls_test_opaque_import_key()
[all …]
/mbedtls-3.6.0/tests/src/
Dpsa_crypto_helpers.c96 psa_status_t mbedtls_test_record_status(psa_status_t status, in mbedtls_test_record_status() argument
109 fprintf(log, "%d:%s:%s:%d:%s\n", (int) status, func, file, line, expr); in mbedtls_test_record_status()
110 return status; in mbedtls_test_record_status()
159 psa_status_t status = psa_its_get(PSA_CRYPTO_ITS_RANDOM_SEED_UID, in mbedtls_test_inject_entropy_seed_read() local
161 if (status != 0) { in mbedtls_test_inject_entropy_seed_read()
172 psa_status_t status = psa_its_set(PSA_CRYPTO_ITS_RANDOM_SEED_UID, in mbedtls_test_inject_entropy_seed_write() local
174 if (status != 0) { in mbedtls_test_inject_entropy_seed_write()
186 psa_status_t status = mbedtls_psa_inject_entropy(buf, sizeof(buf)); in mbedtls_test_inject_entropy_restore() local
188 if (status != PSA_SUCCESS && status != PSA_ERROR_NOT_PERMITTED) { in mbedtls_test_inject_entropy_restore()
189 return status; in mbedtls_test_inject_entropy_restore()

123456