diff options
author | Jon Spillett <jon.spillett@oracle.com> | 2021-03-15 11:33:21 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-17 17:51:16 +1000 |
commit | d11f644ba5f5c7a6e925e625899589d0cdd2c84b (patch) | |
tree | 3e5cfb0d3af3621a03038f9c56353de930f02f5f /crypto/rsa/rsa_gen.c | |
parent | 062490dbd05a205824a239336f6a60bf00a7ca1d (diff) | |
download | openssl-new-d11f644ba5f5c7a6e925e625899589d0cdd2c84b.tar.gz |
Fix up issues found when running evp_extra_test with a non-default library context
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14478)
Diffstat (limited to 'crypto/rsa/rsa_gen.c')
-rw-r--r-- | crypto/rsa/rsa_gen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index ccd07c33fb..a2192df575 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -103,7 +103,7 @@ static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes, goto err; } - ctx = BN_CTX_new(); + ctx = BN_CTX_new_ex(rsa->libctx); if (ctx == NULL) goto err; BN_CTX_start(ctx); @@ -187,7 +187,8 @@ static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes, for (;;) { redo: - if (!BN_generate_prime_ex(prime, bitsr[i] + adj, 0, NULL, NULL, cb)) + if (!BN_generate_prime_ex2(prime, bitsr[i] + adj, 0, NULL, NULL, + cb, ctx)) goto err; /* * prime should not be equal to p, q, r_3... |