Fix an endless loop in BN_generate_prime_ex
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 4 Jul 2019 15:56:23 +0000 (17:56 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 7 Jul 2019 06:07:25 +0000 (08:07 +0200)
commit9fd44200fe39542c31188de6f3469b438acf39b2
treea0a833dcb64ab228a9dfaaba8205a38c17614e28
parent78af3f6f95cb8327fb423a609586c3c2b0d9c5f9
Fix an endless loop in BN_generate_prime_ex

Happens when trying to generate 4 or 5 bit safe primes.

[extended tests]

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9311)

(cherry picked from commit 291f616ced45c924d639d97fc9ca2cbeaad096cf)
crypto/bn/bn_prime.c
test/bntest.c