mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 02:35:38 +01:00
Rename psa_key_derivation_input_raw
The function dispatches between all the available methods and does not just handle the raw key derivation case like the name suggests.
This commit is contained in:
parent
4b7effd35a
commit
b80a94e2ea
@ -4791,7 +4791,7 @@ static psa_status_t psa_tls12_prf_input( psa_tls12_prf_key_derivation_t *prf,
|
|||||||
#endif /* PSA_PRE_1_0_KEY_DERIVATION */
|
#endif /* PSA_PRE_1_0_KEY_DERIVATION */
|
||||||
#endif /* MBEDTLS_MD_C */
|
#endif /* MBEDTLS_MD_C */
|
||||||
|
|
||||||
static psa_status_t psa_key_derivation_input_raw(
|
static psa_status_t psa_key_derivation_input_internal(
|
||||||
psa_key_derivation_operation_t *operation,
|
psa_key_derivation_operation_t *operation,
|
||||||
psa_key_derivation_step_t step,
|
psa_key_derivation_step_t step,
|
||||||
const uint8_t *data,
|
const uint8_t *data,
|
||||||
@ -4856,8 +4856,8 @@ psa_status_t psa_key_derivation_input_bytes( psa_key_derivation_operation_t *ope
|
|||||||
case PSA_KEY_DERIVATION_INPUT_SALT:
|
case PSA_KEY_DERIVATION_INPUT_SALT:
|
||||||
case PSA_KEY_DERIVATION_INPUT_INFO:
|
case PSA_KEY_DERIVATION_INPUT_INFO:
|
||||||
case PSA_KEY_DERIVATION_INPUT_SEED:
|
case PSA_KEY_DERIVATION_INPUT_SEED:
|
||||||
return( psa_key_derivation_input_raw( operation, step,
|
return( psa_key_derivation_input_internal( operation, step,
|
||||||
data, data_length ) );
|
data, data_length ) );
|
||||||
default:
|
default:
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
}
|
}
|
||||||
@ -4884,10 +4884,10 @@ psa_status_t psa_key_derivation_input_key( psa_key_derivation_operation_t *opera
|
|||||||
* and leak values derived from the key. So be conservative. */
|
* and leak values derived from the key. So be conservative. */
|
||||||
if( step != PSA_KEY_DERIVATION_INPUT_SECRET )
|
if( step != PSA_KEY_DERIVATION_INPUT_SECRET )
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
return( psa_key_derivation_input_raw( operation,
|
return( psa_key_derivation_input_internal( operation,
|
||||||
step,
|
step,
|
||||||
slot->data.raw.data,
|
slot->data.raw.data,
|
||||||
slot->data.raw.bytes ) );
|
slot->data.raw.bytes ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4999,8 +4999,9 @@ static psa_status_t psa_key_agreement_internal( psa_key_derivation_operation_t *
|
|||||||
|
|
||||||
/* Step 2: set up the key derivation to generate key material from
|
/* Step 2: set up the key derivation to generate key material from
|
||||||
* the shared secret. */
|
* the shared secret. */
|
||||||
status = psa_key_derivation_input_raw( operation, step,
|
status = psa_key_derivation_input_internal( operation, step,
|
||||||
shared_secret, shared_secret_length );
|
shared_secret,
|
||||||
|
shared_secret_length );
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
mbedtls_platform_zeroize( shared_secret, shared_secret_length );
|
mbedtls_platform_zeroize( shared_secret, shared_secret_length );
|
||||||
|
Loading…
Reference in New Issue
Block a user