mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-09-30 05:57:24 +00:00
RSA: remove undocumented check
This only made the function harder to use. Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
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)) */
|
* 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);
|
ret = mbedtls_rsa_deduce_private_exponent(&ctx->P, &ctx->Q, &ctx->E, &ctx->D);
|
||||||
if (ret == MBEDTLS_ERR_MPI_NOT_ACCEPTABLE) {
|
if (ret == MBEDTLS_ERR_MPI_NOT_ACCEPTABLE) {
|
||||||
mbedtls_mpi_lset(&ctx->D, 0); /* needed for the next call */
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ int mbedtls_rsa_deduce_private_exponent(mbedtls_mpi const *P,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
mbedtls_mpi K, L;
|
mbedtls_mpi K, L;
|
||||||
|
|
||||||
if (D == NULL || mbedtls_mpi_cmp_int(D, 0) != 0) {
|
if (D == NULL) {
|
||||||
return MBEDTLS_ERR_MPI_BAD_INPUT_DATA;
|
return MBEDTLS_ERR_MPI_BAD_INPUT_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user