Make RSA_generate_multi_prime_key() not segfault if e is NULL.
authorslontis <shane.lontis@oracle.com>
Wed, 11 Jan 2023 04:32:07 +0000 (14:32 +1000)
committerTodd Short <todd.short@me.com>
Thu, 12 Jan 2023 15:46:22 +0000 (10:46 -0500)
commit7efc653c43851dcbc3ec043baded029c7d31ab9f
tree9f577f989bd8404d0f9dd1c4d203964b50dcacfa
parentbb4a32ba24ab186aba0b45150934d9eae68d78d5
Make RSA_generate_multi_prime_key() not segfault if e is NULL.

This is not a big problem for higher level keygen, as these set e
beforehand to a default value. But the logic at the lower level is
incorrect since it was doing a NULL check in one place but then
segfaulting during a later BN_copy().

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20025)
crypto/rsa/rsa_gen.c
test/rsa_mp_test.c