mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-03-20 19:21:09 +01:00
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:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user