Lines Matching refs:status
46 static int local_err_translation(psa_status_t status) in local_err_translation() argument
48 return psa_status_to_mbedtls(status, psa_to_ssl_errors, in local_err_translation()
52 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument
841 psa_status_t status; in mbedtls_ssl_reset_checksum() local
850 status = psa_hash_abort(&ssl->handshake->fin_sha256_psa); in mbedtls_ssl_reset_checksum()
851 if (status != PSA_SUCCESS) { in mbedtls_ssl_reset_checksum()
852 return mbedtls_md_error_from_psa(status); in mbedtls_ssl_reset_checksum()
854 status = psa_hash_setup(&ssl->handshake->fin_sha256_psa, PSA_ALG_SHA_256); in mbedtls_ssl_reset_checksum()
855 if (status != PSA_SUCCESS) { in mbedtls_ssl_reset_checksum()
856 return mbedtls_md_error_from_psa(status); in mbedtls_ssl_reset_checksum()
875 status = psa_hash_abort(&ssl->handshake->fin_sha384_psa); in mbedtls_ssl_reset_checksum()
876 if (status != PSA_SUCCESS) { in mbedtls_ssl_reset_checksum()
877 return mbedtls_md_error_from_psa(status); in mbedtls_ssl_reset_checksum()
879 status = psa_hash_setup(&ssl->handshake->fin_sha384_psa, PSA_ALG_SHA_384); in mbedtls_ssl_reset_checksum()
880 if (status != PSA_SUCCESS) { in mbedtls_ssl_reset_checksum()
881 return mbedtls_md_error_from_psa(status); in mbedtls_ssl_reset_checksum()
906 psa_status_t status; in ssl_update_checksum_start() local
917 status = psa_hash_update(&ssl->handshake->fin_sha256_psa, buf, len); in ssl_update_checksum_start()
918 if (status != PSA_SUCCESS) { in ssl_update_checksum_start()
919 return mbedtls_md_error_from_psa(status); in ssl_update_checksum_start()
930 status = psa_hash_update(&ssl->handshake->fin_sha384_psa, buf, len); in ssl_update_checksum_start()
931 if (status != PSA_SUCCESS) { in ssl_update_checksum_start()
932 return mbedtls_md_error_from_psa(status); in ssl_update_checksum_start()
1970 psa_status_t status; in mbedtls_ssl_set_hs_ecjpake_password_common() local
1983 status = psa_pake_setup(&ssl->handshake->psa_pake_ctx, &cipher_suite); in mbedtls_ssl_set_hs_ecjpake_password_common()
1984 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_common()
1985 return status; in mbedtls_ssl_set_hs_ecjpake_password_common()
2000 status = psa_pake_set_user(&ssl->handshake->psa_pake_ctx, user, user_len); in mbedtls_ssl_set_hs_ecjpake_password_common()
2001 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_common()
2002 return status; in mbedtls_ssl_set_hs_ecjpake_password_common()
2005 status = psa_pake_set_peer(&ssl->handshake->psa_pake_ctx, peer, peer_len); in mbedtls_ssl_set_hs_ecjpake_password_common()
2006 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_common()
2007 return status; in mbedtls_ssl_set_hs_ecjpake_password_common()
2010 status = psa_pake_set_password_key(&ssl->handshake->psa_pake_ctx, pwd); in mbedtls_ssl_set_hs_ecjpake_password_common()
2011 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_common()
2012 return status; in mbedtls_ssl_set_hs_ecjpake_password_common()
2025 psa_status_t status; in mbedtls_ssl_set_hs_ecjpake_password() local
2040 status = psa_import_key(&attributes, pw, pw_len, in mbedtls_ssl_set_hs_ecjpake_password()
2042 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password()
2046 status = mbedtls_ssl_set_hs_ecjpake_password_common(ssl, in mbedtls_ssl_set_hs_ecjpake_password()
2048 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password()
2060 psa_status_t status; in mbedtls_ssl_set_hs_ecjpake_password_opaque() local
2070 status = mbedtls_ssl_set_hs_ecjpake_password_common(ssl, pwd); in mbedtls_ssl_set_hs_ecjpake_password_opaque()
2071 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_opaque()
2246 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_set_hs_psk() local
2284 status = psa_import_key(&key_attributes, psk, psk_len, &key); in mbedtls_ssl_set_hs_psk()
2285 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_psk()
2442 psa_status_t status; in mbedtls_ssl_get_mode_from_ciphersuite() local
2446 status = mbedtls_ssl_cipher_to_psa((mbedtls_cipher_type_t) suite->cipher, in mbedtls_ssl_get_mode_from_ciphersuite()
2448 if (status == PSA_SUCCESS) { in mbedtls_ssl_get_mode_from_ciphersuite()
6443 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_get_handshake_transcript() local
6466 status = psa_hash_clone(hash_operation_to_clone, &hash_operation); in mbedtls_ssl_get_handshake_transcript()
6467 if (status != PSA_SUCCESS) { in mbedtls_ssl_get_handshake_transcript()
6471 status = psa_hash_finish(&hash_operation, dst, dst_len, olen); in mbedtls_ssl_get_handshake_transcript()
6472 if (status != PSA_SUCCESS) { in mbedtls_ssl_get_handshake_transcript()
6481 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_ssl_get_handshake_transcript()
6713 psa_status_t status; in setup_psa_key_derivation() local
6715 status = psa_key_derivation_setup(derivation, alg); in setup_psa_key_derivation()
6716 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6717 return status; in setup_psa_key_derivation()
6721 status = psa_key_derivation_input_bytes(derivation, in setup_psa_key_derivation()
6724 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6725 return status; in setup_psa_key_derivation()
6729 status = psa_key_derivation_input_bytes(derivation, in setup_psa_key_derivation()
6732 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6733 return status; in setup_psa_key_derivation()
6738 status = psa_key_derivation_input_bytes( in setup_psa_key_derivation()
6742 status = psa_key_derivation_input_key( in setup_psa_key_derivation()
6745 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6746 return status; in setup_psa_key_derivation()
6749 status = psa_key_derivation_input_bytes(derivation, in setup_psa_key_derivation()
6752 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6753 return status; in setup_psa_key_derivation()
6759 status = psa_key_derivation_set_capacity(derivation, capacity); in setup_psa_key_derivation()
6760 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6761 return status; in setup_psa_key_derivation()
6776 psa_status_t status; in tls_prf_generic() local
6801 status = psa_import_key(&key_attributes, secret, slen, &master_key); in tls_prf_generic()
6802 if (status != PSA_SUCCESS) { in tls_prf_generic()
6807 status = setup_psa_key_derivation(&derivation, in tls_prf_generic()
6815 if (status != PSA_SUCCESS) { in tls_prf_generic()
6821 status = psa_key_derivation_output_bytes(&derivation, dstbuf, dlen); in tls_prf_generic()
6822 if (status != PSA_SUCCESS) { in tls_prf_generic()
6828 status = psa_key_derivation_abort(&derivation); in tls_prf_generic()
6829 if (status != PSA_SUCCESS) { in tls_prf_generic()
6835 status = psa_destroy_key(master_key); in tls_prf_generic()
6837 if (status != PSA_SUCCESS) { in tls_prf_generic()
7093 psa_status_t status; in ssl_compute_master() local
7132 status = setup_psa_key_derivation(&derivation, psk, alg, in ssl_compute_master()
7139 if (status != PSA_SUCCESS) { in ssl_compute_master()
7144 status = psa_key_derivation_output_bytes(&derivation, in ssl_compute_master()
7147 if (status != PSA_SUCCESS) { in ssl_compute_master()
7152 status = psa_key_derivation_abort(&derivation); in ssl_compute_master()
7153 if (status != PSA_SUCCESS) { in ssl_compute_master()
7162 psa_status_t status; in ssl_compute_master() local
7171 status = psa_key_derivation_setup(&derivation, alg); in ssl_compute_master()
7172 if (status != PSA_SUCCESS) { in ssl_compute_master()
7176 status = psa_key_derivation_set_capacity(&derivation, in ssl_compute_master()
7178 if (status != PSA_SUCCESS) { in ssl_compute_master()
7183 status = psa_pake_get_implicit_key(&handshake->psa_pake_ctx, in ssl_compute_master()
7185 if (status != PSA_SUCCESS) { in ssl_compute_master()
7190 status = psa_key_derivation_output_bytes(&derivation, in ssl_compute_master()
7193 if (status != PSA_SUCCESS) { in ssl_compute_master()
7198 status = psa_key_derivation_abort(&derivation); in ssl_compute_master()
7199 if (status != PSA_SUCCESS) { in ssl_compute_master()
7316 psa_status_t status; in ssl_calc_verify_tls_psa() local
7323 status = psa_hash_clone(hs_op, &cloned_op); in ssl_calc_verify_tls_psa()
7324 if (status != PSA_SUCCESS) { in ssl_calc_verify_tls_psa()
7328 status = psa_hash_finish(&cloned_op, hash, buffer_size, hlen); in ssl_calc_verify_tls_psa()
7329 if (status != PSA_SUCCESS) { in ssl_calc_verify_tls_psa()
7338 return mbedtls_md_error_from_psa(status); in ssl_calc_verify_tls_psa()
8166 psa_status_t status; in ssl_calc_finished_tls_generic() local
8189 status = psa_hash_clone(hs_op, &cloned_op); in ssl_calc_finished_tls_generic()
8190 if (status != PSA_SUCCESS) { in ssl_calc_finished_tls_generic()
8194 status = psa_hash_finish(&cloned_op, padbuf, hlen, &hash_size); in ssl_calc_finished_tls_generic()
8195 if (status != PSA_SUCCESS) { in ssl_calc_finished_tls_generic()
8236 return mbedtls_md_error_from_psa(status); in ssl_calc_finished_tls_generic()
8661 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in ssl_tls12_populate_transform() local
8706 if ((status = mbedtls_ssl_cipher_to_psa((mbedtls_cipher_type_t) ciphersuite_info->cipher, in ssl_tls12_populate_transform()
8711 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
8952 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
8956 MBEDTLS_SSL_DEBUG_RET(3, "psa_import_key", (int) status); in ssl_tls12_populate_transform()
8957 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
8964 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
8968 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
9028 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
9031 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
9049 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
9052 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
9084 psa_status_t status; in mbedtls_psa_ecjpake_read_round() local
9104 status = psa_pake_input(pake_ctx, step, in mbedtls_psa_ecjpake_read_round()
9106 if (status != PSA_SUCCESS) { in mbedtls_psa_ecjpake_read_round()
9107 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_psa_ecjpake_read_round()
9127 psa_status_t status; in mbedtls_psa_ecjpake_write_round() local
9144 status = psa_pake_output(pake_ctx, step, in mbedtls_psa_ecjpake_write_round()
9148 if (status != PSA_SUCCESS) { in mbedtls_psa_ecjpake_write_round()
9149 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_psa_ecjpake_write_round()
9170 psa_status_t status; in mbedtls_ssl_get_key_exchange_md_tls1_2() local
9176 if ((status = psa_hash_setup(&hash_operation, in mbedtls_ssl_get_key_exchange_md_tls1_2()
9178 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_setup", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
9182 if ((status = psa_hash_update(&hash_operation, ssl->handshake->randbytes, in mbedtls_ssl_get_key_exchange_md_tls1_2()
9184 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_update", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
9188 if ((status = psa_hash_update(&hash_operation, in mbedtls_ssl_get_key_exchange_md_tls1_2()
9190 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_update", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
9194 if ((status = psa_hash_finish(&hash_operation, hash, PSA_HASH_MAX_SIZE, in mbedtls_ssl_get_key_exchange_md_tls1_2()
9196 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_finish", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
9201 if (status != PSA_SUCCESS) { in mbedtls_ssl_get_key_exchange_md_tls1_2()
9204 switch (status) { in mbedtls_ssl_get_key_exchange_md_tls1_2()