mirror of
https://github.com/openssl/openssl.git
synced 2024-12-27 06:21:43 +08:00
remove sanity check from ossl_rsa_todata
Theres no reason we should gate ossl_rsa_todata on there being a minimum set of parameters. EVP_PKEY_todata makes no guarantees about the validity of a key, it only returns the parameters that are set in the requested key, whatever they may be. Remove the check. Fixes #21935 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22334)
This commit is contained in:
parent
15a39e7025
commit
4ad3a44ba4
@ -141,18 +141,6 @@ int ossl_rsa_todata(RSA *rsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
|
|||||||
|
|
||||||
/* Check private key data integrity */
|
/* Check private key data integrity */
|
||||||
if (include_private && rsa_d != NULL) {
|
if (include_private && rsa_d != NULL) {
|
||||||
int numprimes = sk_BIGNUM_const_num(factors);
|
|
||||||
int numexps = sk_BIGNUM_const_num(exps);
|
|
||||||
int numcoeffs = sk_BIGNUM_const_num(coeffs);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* It's permissible to have zero primes, i.e. no CRT params.
|
|
||||||
* Otherwise, there must be at least two, as many exponents,
|
|
||||||
* and one coefficient less.
|
|
||||||
*/
|
|
||||||
if (numprimes != 0
|
|
||||||
&& (numprimes < 2 || numexps < 2 || numcoeffs < 1))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
|
if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
|
||||||
rsa_d)
|
rsa_d)
|
||||||
|
Loading…
Reference in New Issue
Block a user