[crypto/rsa] Set the constant-time flag in multi-prime RSA too
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9779)
This commit is contained in:
parent
311e903d84
commit
d2baf88c43
1 changed files with 6 additions and 3 deletions
|
@ -409,12 +409,15 @@ int RSA_set0_multi_prime_params(RSA *r, BIGNUM *primes[], BIGNUM *exps[],
|
||||||
if (pinfo == NULL)
|
if (pinfo == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
if (primes[i] != NULL && exps[i] != NULL && coeffs[i] != NULL) {
|
if (primes[i] != NULL && exps[i] != NULL && coeffs[i] != NULL) {
|
||||||
BN_free(pinfo->r);
|
BN_clear_free(pinfo->r);
|
||||||
BN_free(pinfo->d);
|
BN_clear_free(pinfo->d);
|
||||||
BN_free(pinfo->t);
|
BN_clear_free(pinfo->t);
|
||||||
pinfo->r = primes[i];
|
pinfo->r = primes[i];
|
||||||
pinfo->d = exps[i];
|
pinfo->d = exps[i];
|
||||||
pinfo->t = coeffs[i];
|
pinfo->t = coeffs[i];
|
||||||
|
BN_set_flags(pinfo->r, BN_FLG_CONSTTIME);
|
||||||
|
BN_set_flags(pinfo->d, BN_FLG_CONSTTIME);
|
||||||
|
BN_set_flags(pinfo->t, BN_FLG_CONSTTIME);
|
||||||
} else {
|
} else {
|
||||||
rsa_multip_info_free(pinfo);
|
rsa_multip_info_free(pinfo);
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue