Reject too small bits value in BN_generate_prime_ex(), so that it does not risk
authormiod <miod@openbsd.org>
Wed, 21 Oct 2015 19:02:22 +0000 (19:02 +0000)
committermiod <miod@openbsd.org>
Wed, 21 Oct 2015 19:02:22 +0000 (19:02 +0000)
commite123f381340b82bb7ccf2326148fe34569125006
tree40d856629607e6a53851aa36b2b53fe60690f618
parentb2bdef47793cce8a656709b8b0dfb3ec9a9e6efb
Reject too small bits value in BN_generate_prime_ex(), so that it does not risk
becoming negative in probable_prime_dh_safe(). Reported by Franck Denis who
noticed `openssl gendh 0' would segfault.
Fix adapted from OpenSSL RT#2701.

ok beck@ jsing@
lib/libcrypto/bn/bn.h
lib/libcrypto/bn/bn_err.c
lib/libcrypto/bn/bn_prime.c
lib/libssl/src/crypto/bn/bn.h
lib/libssl/src/crypto/bn/bn_err.c
lib/libssl/src/crypto/bn/bn_prime.c