mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Optimieze psa_pake_complete_inputs()
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
@ -7478,8 +7478,8 @@ static psa_status_t psa_pake_complete_inputs(
|
|||||||
with the driver context which will be setup by the driver. */
|
with the driver context which will be setup by the driver. */
|
||||||
psa_crypto_driver_pake_inputs_t inputs = operation->data.inputs;
|
psa_crypto_driver_pake_inputs_t inputs = operation->data.inputs;
|
||||||
|
|
||||||
if (operation->data.inputs.password_len == 0 ||
|
if (inputs.password_len == 0 ||
|
||||||
operation->data.inputs.role == PSA_PAKE_ROLE_NONE) {
|
inputs.role == PSA_PAKE_ROLE_NONE) {
|
||||||
return PSA_ERROR_BAD_STATE;
|
return PSA_ERROR_BAD_STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7503,8 +7503,8 @@ static psa_status_t psa_pake_complete_inputs(
|
|||||||
computation_stage->output_step = PSA_PAKE_STEP_X1_X2;
|
computation_stage->output_step = PSA_PAKE_STEP_X1_X2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
operation->data.inputs.password_len = 0;
|
inputs.password_len = 0;
|
||||||
operation->data.inputs.password = NULL;
|
inputs.password = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
@ -7888,7 +7888,7 @@ psa_status_t psa_pake_abort(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (operation->stage == PSA_PAKE_OPERATION_STAGE_COLLECT_INPUTS &&
|
if (operation->stage == PSA_PAKE_OPERATION_STAGE_COLLECT_INPUTS &&
|
||||||
operation->data.inputs.password_len > 0) {
|
operation->data.inputs.password != NULL) {
|
||||||
mbedtls_platform_zeroize(operation->data.inputs.password,
|
mbedtls_platform_zeroize(operation->data.inputs.password,
|
||||||
operation->data.inputs.password_len);
|
operation->data.inputs.password_len);
|
||||||
mbedtls_free(operation->data.inputs.password);
|
mbedtls_free(operation->data.inputs.password);
|
||||||
|
Reference in New Issue
Block a user