RSA: remove undocumented check

This only made the function harder to use.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard
2025-12-03 11:35:28 +01:00
parent 30c2fa00af
commit f90c04d646
2 changed files with 1 additions and 2 deletions

View File

@@ -1101,7 +1101,6 @@ int mbedtls_rsa_gen_key(mbedtls_rsa_context *ctx,
* if it exists (FIPS 186-4 §B.3.1 criterion 2(a)) */
ret = mbedtls_rsa_deduce_private_exponent(&ctx->P, &ctx->Q, &ctx->E, &ctx->D);
if (ret == MBEDTLS_ERR_MPI_NOT_ACCEPTABLE) {
mbedtls_mpi_lset(&ctx->D, 0); /* needed for the next call */
continue;
}
if (ret != 0) {

View File

@@ -188,7 +188,7 @@ int mbedtls_rsa_deduce_private_exponent(mbedtls_mpi const *P,
int ret = 0;
mbedtls_mpi K, L;
if (D == NULL || mbedtls_mpi_cmp_int(D, 0) != 0) {
if (D == NULL) {
return MBEDTLS_ERR_MPI_BAD_INPUT_DATA;
}