Lines Matching refs:status

42 static int local_err_translation(psa_status_t status)  in local_err_translation()  argument
44 return psa_status_to_mbedtls(status, psa_to_ssl_errors, in local_err_translation()
48 #define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) argument
835 psa_status_t status; in mbedtls_ssl_reset_checksum() local
840 status = psa_hash_abort(&ssl->handshake->fin_sha256_psa); in mbedtls_ssl_reset_checksum()
841 if (status != PSA_SUCCESS) { in mbedtls_ssl_reset_checksum()
842 return mbedtls_md_error_from_psa(status); in mbedtls_ssl_reset_checksum()
844 status = psa_hash_setup(&ssl->handshake->fin_sha256_psa, PSA_ALG_SHA_256); in mbedtls_ssl_reset_checksum()
845 if (status != PSA_SUCCESS) { in mbedtls_ssl_reset_checksum()
846 return mbedtls_md_error_from_psa(status); in mbedtls_ssl_reset_checksum()
850 status = psa_hash_abort(&ssl->handshake->fin_sha384_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_sha384_psa, PSA_ALG_SHA_384); 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()
867 psa_status_t status; in ssl_update_checksum_start() local
874 status = psa_hash_update(&ssl->handshake->fin_sha256_psa, buf, len); in ssl_update_checksum_start()
875 if (status != PSA_SUCCESS) { in ssl_update_checksum_start()
876 return mbedtls_md_error_from_psa(status); in ssl_update_checksum_start()
880 status = psa_hash_update(&ssl->handshake->fin_sha384_psa, buf, len); in ssl_update_checksum_start()
881 if (status != PSA_SUCCESS) { in ssl_update_checksum_start()
882 return mbedtls_md_error_from_psa(status); in ssl_update_checksum_start()
1750 psa_status_t status; in mbedtls_ssl_set_hs_ecjpake_password_common() local
1762 status = psa_pake_setup(&ssl->handshake->psa_pake_ctx, pwd, &cipher_suite); in mbedtls_ssl_set_hs_ecjpake_password_common()
1763 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_common()
1764 return status; in mbedtls_ssl_set_hs_ecjpake_password_common()
1779 status = psa_pake_set_user(&ssl->handshake->psa_pake_ctx, user, user_len); in mbedtls_ssl_set_hs_ecjpake_password_common()
1780 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_common()
1781 return status; in mbedtls_ssl_set_hs_ecjpake_password_common()
1784 status = psa_pake_set_peer(&ssl->handshake->psa_pake_ctx, peer, peer_len); in mbedtls_ssl_set_hs_ecjpake_password_common()
1785 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_common()
1786 return status; in mbedtls_ssl_set_hs_ecjpake_password_common()
1799 psa_status_t status; in mbedtls_ssl_set_hs_ecjpake_password() local
1814 status = psa_import_key(&attributes, pw, pw_len, in mbedtls_ssl_set_hs_ecjpake_password()
1816 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password()
1820 status = mbedtls_ssl_set_hs_ecjpake_password_common(ssl, in mbedtls_ssl_set_hs_ecjpake_password()
1822 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password()
1834 psa_status_t status; in mbedtls_ssl_set_hs_ecjpake_password_opaque() local
1844 status = mbedtls_ssl_set_hs_ecjpake_password_common(ssl, pwd); in mbedtls_ssl_set_hs_ecjpake_password_opaque()
1845 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_ecjpake_password_opaque()
1977 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_set_hs_psk() local
2013 status = psa_import_key(&key_attributes, psk, psk_len, &key); in mbedtls_ssl_set_hs_psk()
2014 if (status != PSA_SUCCESS) { in mbedtls_ssl_set_hs_psk()
2129 psa_status_t status; in mbedtls_ssl_get_mode_from_ciphersuite() local
2133 status = mbedtls_ssl_cipher_to_psa((mbedtls_cipher_type_t) suite->cipher, in mbedtls_ssl_get_mode_from_ciphersuite()
2135 if (status == PSA_SUCCESS) { in mbedtls_ssl_get_mode_from_ciphersuite()
5878 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in mbedtls_ssl_get_handshake_transcript() local
5901 status = psa_hash_clone(hash_operation_to_clone, &hash_operation); in mbedtls_ssl_get_handshake_transcript()
5902 if (status != PSA_SUCCESS) { in mbedtls_ssl_get_handshake_transcript()
5906 status = psa_hash_finish(&hash_operation, dst, dst_len, olen); in mbedtls_ssl_get_handshake_transcript()
5907 if (status != PSA_SUCCESS) { in mbedtls_ssl_get_handshake_transcript()
5916 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_ssl_get_handshake_transcript()
6037 psa_status_t status; in setup_psa_key_derivation() local
6039 status = psa_key_derivation_setup(derivation, alg); in setup_psa_key_derivation()
6040 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6041 return status; in setup_psa_key_derivation()
6045 status = psa_key_derivation_input_bytes(derivation, in setup_psa_key_derivation()
6048 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6049 return status; in setup_psa_key_derivation()
6053 status = psa_key_derivation_input_bytes(derivation, in setup_psa_key_derivation()
6056 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6057 return status; in setup_psa_key_derivation()
6062 status = psa_key_derivation_input_bytes( in setup_psa_key_derivation()
6066 status = psa_key_derivation_input_key( in setup_psa_key_derivation()
6069 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6070 return status; in setup_psa_key_derivation()
6073 status = psa_key_derivation_input_bytes(derivation, in setup_psa_key_derivation()
6076 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6077 return status; in setup_psa_key_derivation()
6083 status = psa_key_derivation_set_capacity(derivation, capacity); in setup_psa_key_derivation()
6084 if (status != PSA_SUCCESS) { in setup_psa_key_derivation()
6085 return status; in setup_psa_key_derivation()
6100 psa_status_t status; in tls_prf_generic() local
6125 status = psa_import_key(&key_attributes, secret, slen, &master_key); in tls_prf_generic()
6126 if (status != PSA_SUCCESS) { in tls_prf_generic()
6131 status = setup_psa_key_derivation(&derivation, in tls_prf_generic()
6139 if (status != PSA_SUCCESS) { in tls_prf_generic()
6145 status = psa_key_derivation_output_bytes(&derivation, dstbuf, dlen); in tls_prf_generic()
6146 if (status != PSA_SUCCESS) { in tls_prf_generic()
6152 status = psa_key_derivation_abort(&derivation); in tls_prf_generic()
6153 if (status != PSA_SUCCESS) { in tls_prf_generic()
6159 status = psa_destroy_key(master_key); in tls_prf_generic()
6161 if (status != PSA_SUCCESS) { in tls_prf_generic()
6305 psa_status_t status; in ssl_compute_master() local
6338 status = setup_psa_key_derivation(&derivation, psk, alg, in ssl_compute_master()
6345 if (status != PSA_SUCCESS) { in ssl_compute_master()
6350 status = psa_key_derivation_output_bytes(&derivation, in ssl_compute_master()
6353 if (status != PSA_SUCCESS) { in ssl_compute_master()
6358 status = psa_key_derivation_abort(&derivation); in ssl_compute_master()
6359 if (status != PSA_SUCCESS) { in ssl_compute_master()
6367 psa_status_t status; in ssl_compute_master() local
6376 status = psa_key_derivation_setup(&derivation, alg); in ssl_compute_master()
6377 if (status != PSA_SUCCESS) { in ssl_compute_master()
6381 status = psa_key_derivation_set_capacity(&derivation, in ssl_compute_master()
6383 if (status != PSA_SUCCESS) { in ssl_compute_master()
6388 status = psa_pake_get_implicit_key(&handshake->psa_pake_ctx, in ssl_compute_master()
6390 if (status != PSA_SUCCESS) { in ssl_compute_master()
6395 status = psa_key_derivation_output_bytes(&derivation, in ssl_compute_master()
6398 if (status != PSA_SUCCESS) { in ssl_compute_master()
6403 status = psa_key_derivation_abort(&derivation); in ssl_compute_master()
6404 if (status != PSA_SUCCESS) { in ssl_compute_master()
6520 psa_status_t status; in ssl_calc_verify_tls_psa() local
6527 status = psa_hash_clone(hs_op, &cloned_op); in ssl_calc_verify_tls_psa()
6528 if (status != PSA_SUCCESS) { in ssl_calc_verify_tls_psa()
6532 status = psa_hash_finish(&cloned_op, hash, buffer_size, hlen); in ssl_calc_verify_tls_psa()
6533 if (status != PSA_SUCCESS) { in ssl_calc_verify_tls_psa()
6542 return mbedtls_md_error_from_psa(status); in ssl_calc_verify_tls_psa()
7189 psa_status_t status; in ssl_calc_finished_tls_generic() local
7205 status = psa_hash_clone(hs_op, &cloned_op); in ssl_calc_finished_tls_generic()
7206 if (status != PSA_SUCCESS) { in ssl_calc_finished_tls_generic()
7210 status = psa_hash_finish(&cloned_op, padbuf, hlen, &hash_size); in ssl_calc_finished_tls_generic()
7211 if (status != PSA_SUCCESS) { in ssl_calc_finished_tls_generic()
7234 return mbedtls_md_error_from_psa(status); in ssl_calc_finished_tls_generic()
7642 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; in ssl_tls12_populate_transform() local
7685 if ((status = mbedtls_ssl_cipher_to_psa((mbedtls_cipher_type_t) ciphersuite_info->cipher, in ssl_tls12_populate_transform()
7690 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
7884 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
7888 MBEDTLS_SSL_DEBUG_RET(3, "psa_import_key", (int) status); in ssl_tls12_populate_transform()
7889 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
7896 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
7900 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
7916 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
7919 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
7937 if ((status = psa_import_key(&attributes, in ssl_tls12_populate_transform()
7940 ret = PSA_TO_MBEDTLS_ERR(status); in ssl_tls12_populate_transform()
7961 psa_status_t status; in mbedtls_psa_ecjpake_read_round() local
7981 status = psa_pake_input(pake_ctx, step, in mbedtls_psa_ecjpake_read_round()
7983 if (status != PSA_SUCCESS) { in mbedtls_psa_ecjpake_read_round()
7984 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_psa_ecjpake_read_round()
8004 psa_status_t status; in mbedtls_psa_ecjpake_write_round() local
8021 status = psa_pake_output(pake_ctx, step, in mbedtls_psa_ecjpake_write_round()
8025 if (status != PSA_SUCCESS) { in mbedtls_psa_ecjpake_write_round()
8026 return PSA_TO_MBEDTLS_ERR(status); in mbedtls_psa_ecjpake_write_round()
8046 psa_status_t status; in mbedtls_ssl_get_key_exchange_md_tls1_2() local
8052 if ((status = psa_hash_setup(&hash_operation, in mbedtls_ssl_get_key_exchange_md_tls1_2()
8054 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_setup", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
8058 if ((status = psa_hash_update(&hash_operation, ssl->handshake->randbytes, in mbedtls_ssl_get_key_exchange_md_tls1_2()
8060 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_update", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
8064 if ((status = psa_hash_update(&hash_operation, in mbedtls_ssl_get_key_exchange_md_tls1_2()
8066 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_update", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
8070 if ((status = psa_hash_finish(&hash_operation, hash, PSA_HASH_MAX_SIZE, in mbedtls_ssl_get_key_exchange_md_tls1_2()
8072 MBEDTLS_SSL_DEBUG_RET(1, "psa_hash_finish", status); in mbedtls_ssl_get_key_exchange_md_tls1_2()
8077 if (status != PSA_SUCCESS) { in mbedtls_ssl_get_key_exchange_md_tls1_2()
8080 switch (status) { in mbedtls_ssl_get_key_exchange_md_tls1_2()