mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 22:15:07 +00:00
Make variable naming consistent
This commit is contained in:
parent
7bb5e6b4da
commit
53b8ec27a2
|
@ -3229,7 +3229,7 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl )
|
||||||
ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA )
|
ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA )
|
||||||
{
|
{
|
||||||
psa_status_t status;
|
psa_status_t status;
|
||||||
psa_key_attributes_t attributes;
|
psa_key_attributes_t key_attributes;
|
||||||
|
|
||||||
mbedtls_ssl_handshake_params *handshake = ssl->handshake;
|
mbedtls_ssl_handshake_params *handshake = ssl->handshake;
|
||||||
|
|
||||||
|
@ -3262,18 +3262,19 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl )
|
||||||
* yet support the provisioning of salt + label to the KDF.
|
* yet support the provisioning of salt + label to the KDF.
|
||||||
* For the time being, we therefore need to split the computation
|
* For the time being, we therefore need to split the computation
|
||||||
* of the ECDH secret and the application of the TLS 1.2 PRF. */
|
* of the ECDH secret and the application of the TLS 1.2 PRF. */
|
||||||
attributes = psa_key_attributes_init();
|
key_attributes = psa_key_attributes_init();
|
||||||
psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_DERIVE );
|
psa_set_key_usage_flags( &key_attributes, PSA_KEY_USAGE_DERIVE );
|
||||||
psa_set_key_algorithm( &attributes,
|
psa_set_key_algorithm( &key_attributes,
|
||||||
PSA_ALG_ECDH( PSA_ALG_SELECT_RAW ) );
|
PSA_ALG_ECDH( PSA_ALG_SELECT_RAW ) );
|
||||||
psa_set_key_type( &attributes,
|
psa_set_key_type( &key_attributes,
|
||||||
PSA_KEY_TYPE_ECC_KEY_PAIR( handshake->ecdh_psa_curve )
|
PSA_KEY_TYPE_ECC_KEY_PAIR( handshake->ecdh_psa_curve )
|
||||||
);
|
);
|
||||||
psa_set_key_bits( &key_attributes,
|
psa_set_key_bits( &key_attributes,
|
||||||
PSA_ECC_CURVE_BITS( handshake->ecdh_psa_curve ) );
|
PSA_ECC_CURVE_BITS( handshake->ecdh_psa_curve ) );
|
||||||
|
|
||||||
/* Generate ECDH private key. */
|
/* Generate ECDH private key. */
|
||||||
status = psa_generate_key( &attributes, handshake->ecdh_psa_privkey );
|
status = psa_generate_key( &key_attributes,
|
||||||
|
handshake->ecdh_psa_privkey );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
|
return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
|
||||||
|
|
||||||
|
|
|
@ -630,7 +630,7 @@ static int tls_prf_generic( mbedtls_md_type_t md_type,
|
||||||
{
|
{
|
||||||
psa_status_t status;
|
psa_status_t status;
|
||||||
psa_algorithm_t alg;
|
psa_algorithm_t alg;
|
||||||
psa_key_attributes_t attributes;
|
psa_key_attributes_t key_attributes;
|
||||||
psa_key_handle_t master_slot;
|
psa_key_handle_t master_slot;
|
||||||
psa_key_derivation_operation_t generator =
|
psa_key_derivation_operation_t generator =
|
||||||
PSA_KEY_DERIVATION_OPERATION_INIT;
|
PSA_KEY_DERIVATION_OPERATION_INIT;
|
||||||
|
@ -643,12 +643,12 @@ static int tls_prf_generic( mbedtls_md_type_t md_type,
|
||||||
else
|
else
|
||||||
alg = PSA_ALG_TLS12_PRF(PSA_ALG_SHA_256);
|
alg = PSA_ALG_TLS12_PRF(PSA_ALG_SHA_256);
|
||||||
|
|
||||||
attributes = psa_key_attributes_init();
|
key_attributes = psa_key_attributes_init();
|
||||||
psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_DERIVE );
|
psa_set_key_usage_flags( &key_attributes, PSA_KEY_USAGE_DERIVE );
|
||||||
psa_set_key_algorithm( &attributes, alg );
|
psa_set_key_algorithm( &key_attributes, alg );
|
||||||
psa_set_key_type( &attributes, PSA_KEY_TYPE_DERIVE );
|
psa_set_key_type( &key_attributes, PSA_KEY_TYPE_DERIVE );
|
||||||
|
|
||||||
status = psa_import_key( &attributes, secret, slen, &master_slot );
|
status = psa_import_key( &key_attributes, secret, slen, &master_slot );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
|
return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue