From: Matt Caswell Date: Thu, 12 Apr 2018 11:07:53 +0000 (+0100) Subject: RSA key generation: ensure BN_mod_inverse and BN_mod_exp_mont both get called with... X-Git-Tag: OpenSSL_1_1_1-pre5~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=54f007af94b8924a46786b34665223c127c19081;p=oweals%2Fopenssl.git RSA key generation: ensure BN_mod_inverse and BN_mod_exp_mont both get called with BN_FLG_CONSTTIME flag set. Based on an original patch by Billy Brumley CVE-2018-0737 Reviewed-by: Rich Salz --- diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index d8ef3c7e6a..7f0a256481 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -157,6 +157,7 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, int primes, BIGNUM *e_value, pinfo = sk_RSA_PRIME_INFO_value(prime_infos, i - 2); prime = pinfo->r; } + BN_set_flags(prime, BN_FLG_CONSTTIME); for (;;) { redo: