Remove pake abort on failure from driver (handled by core)
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
e1d51bf3c9
commit
849c35f8b4
1 changed files with 5 additions and 20 deletions
|
@ -230,14 +230,12 @@ psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation,
|
||||||
cipher_suite.family != PSA_ECC_FAMILY_SECP_R1 ||
|
cipher_suite.family != PSA_ECC_FAMILY_SECP_R1 ||
|
||||||
cipher_suite.bits != 256 ||
|
cipher_suite.bits != 256 ||
|
||||||
cipher_suite.hash != PSA_ALG_SHA_256) {
|
cipher_suite.hash != PSA_ALG_SHA_256) {
|
||||||
status = PSA_ERROR_NOT_SUPPORTED;
|
return PSA_ERROR_NOT_SUPPORTED;
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role != PSA_PAKE_ROLE_CLIENT &&
|
if (role != PSA_PAKE_ROLE_CLIENT &&
|
||||||
role != PSA_PAKE_ROLE_SERVER) {
|
role != PSA_PAKE_ROLE_SERVER) {
|
||||||
status = PSA_ERROR_NOT_SUPPORTED;
|
return PSA_ERROR_NOT_SUPPORTED;
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_ecjpake_init(&operation->ctx.pake);
|
mbedtls_ecjpake_init(&operation->ctx.pake);
|
||||||
|
@ -245,13 +243,13 @@ psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation,
|
||||||
operation->password = mbedtls_calloc(1, password_len);
|
operation->password = mbedtls_calloc(1, password_len);
|
||||||
if (operation->password == NULL) {
|
if (operation->password == NULL) {
|
||||||
status = PSA_ERROR_INSUFFICIENT_MEMORY;
|
status = PSA_ERROR_INSUFFICIENT_MEMORY;
|
||||||
goto error;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = psa_crypto_driver_pake_get_password(inputs, operation->password,
|
status = psa_crypto_driver_pake_get_password(inputs, operation->password,
|
||||||
password_len, &actual_password_len);
|
password_len, &actual_password_len);
|
||||||
if (status != PSA_SUCCESS) {
|
if (status != PSA_SUCCESS) {
|
||||||
goto error;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
operation->password_len = actual_password_len;
|
operation->password_len = actual_password_len;
|
||||||
|
@ -265,7 +263,7 @@ psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation,
|
||||||
status = psa_pake_ecjpake_setup(operation);
|
status = psa_pake_ecjpake_setup(operation);
|
||||||
|
|
||||||
if (status != PSA_SUCCESS) {
|
if (status != PSA_SUCCESS) {
|
||||||
goto error;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PSA_SUCCESS;
|
return PSA_SUCCESS;
|
||||||
|
@ -276,8 +274,6 @@ psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation,
|
||||||
#endif
|
#endif
|
||||||
{ status = PSA_ERROR_NOT_SUPPORTED; }
|
{ status = PSA_ERROR_NOT_SUPPORTED; }
|
||||||
|
|
||||||
error:
|
|
||||||
mbedtls_psa_pake_abort(operation);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,10 +395,6 @@ psa_status_t mbedtls_psa_pake_output(mbedtls_psa_pake_operation_t *operation,
|
||||||
psa_status_t status = mbedtls_psa_pake_output_internal(
|
psa_status_t status = mbedtls_psa_pake_output_internal(
|
||||||
operation, step, output, output_size, output_length);
|
operation, step, output, output_size, output_length);
|
||||||
|
|
||||||
if (status != PSA_SUCCESS) {
|
|
||||||
mbedtls_psa_pake_abort(operation);
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,10 +498,6 @@ psa_status_t mbedtls_psa_pake_input(mbedtls_psa_pake_operation_t *operation,
|
||||||
psa_status_t status = mbedtls_psa_pake_input_internal(
|
psa_status_t status = mbedtls_psa_pake_input_internal(
|
||||||
operation, step, input, input_length);
|
operation, step, input, input_length);
|
||||||
|
|
||||||
if (status != PSA_SUCCESS) {
|
|
||||||
mbedtls_psa_pake_abort(operation);
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +516,6 @@ psa_status_t mbedtls_psa_pake_get_implicit_key(
|
||||||
mbedtls_psa_get_random,
|
mbedtls_psa_get_random,
|
||||||
MBEDTLS_PSA_RANDOM_STATE);
|
MBEDTLS_PSA_RANDOM_STATE);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
mbedtls_psa_pake_abort(operation);
|
|
||||||
return mbedtls_ecjpake_to_psa_error(ret);
|
return mbedtls_ecjpake_to_psa_error(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,8 +524,6 @@ psa_status_t mbedtls_psa_pake_get_implicit_key(
|
||||||
|
|
||||||
mbedtls_platform_zeroize(operation->buffer, MBEDTLS_PSA_PAKE_BUFFER_SIZE);
|
mbedtls_platform_zeroize(operation->buffer, MBEDTLS_PSA_PAKE_BUFFER_SIZE);
|
||||||
|
|
||||||
mbedtls_psa_pake_abort(operation);
|
|
||||||
|
|
||||||
return PSA_SUCCESS;
|
return PSA_SUCCESS;
|
||||||
} else
|
} else
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue