mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Change mac_size parameter in driver_mac_compute to output length
See #7801 for reference Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
This commit is contained in:
@ -5575,11 +5575,14 @@ static psa_status_t psa_key_derivation_pbkdf2_generate_block(
|
|||||||
memcpy(U_accumulator, U_i, prf_output_length);
|
memcpy(U_accumulator, U_i, prf_output_length);
|
||||||
|
|
||||||
for (i = 1; i < pbkdf2->input_cost; i++) {
|
for (i = 1; i < pbkdf2->input_cost; i++) {
|
||||||
|
/* We are passing prf_output_length as mac_size because the driver
|
||||||
|
* function directly sets mac_output_length as mac_size upon success.
|
||||||
|
* See #7801 */
|
||||||
status = psa_driver_wrapper_mac_compute(attributes,
|
status = psa_driver_wrapper_mac_compute(attributes,
|
||||||
pbkdf2->password,
|
pbkdf2->password,
|
||||||
pbkdf2->password_length,
|
pbkdf2->password_length,
|
||||||
prf_alg, U_i, prf_output_length,
|
prf_alg, U_i, prf_output_length,
|
||||||
U_i, sizeof(U_i),
|
U_i, prf_output_length,
|
||||||
&mac_output_length);
|
&mac_output_length);
|
||||||
if (status != PSA_SUCCESS) {
|
if (status != PSA_SUCCESS) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Reference in New Issue
Block a user