* primegen.c (gen_prime): Bail out if NBITS is zero. This is

Debian bug #213989 reported by Max <rusmir@tula.net>.
This commit is contained in:
Werner Koch 2003-10-06 12:09:46 +00:00
parent 25bf32a078
commit b7bd594c8c
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-10-06 Werner Koch <wk@gnupg.org>
* primegen.c (gen_prime): Bail out if NBITS is zero. This is
Debian bug #213989 reported by Max <rusmir@tula.net>.
2003-09-04 David Shaw <dshaw@jabberwocky.com>
* md.c (string_to_digest_algo): Enable read-write SHA-256 support.

View File

@ -292,7 +292,7 @@ generate_elg_prime( int mode, unsigned pbits, unsigned qbits,
static MPI
gen_prime( unsigned nbits, int secret, int randomlevel )
gen_prime( unsigned int nbits, int secret, int randomlevel )
{
unsigned nlimbs;
MPI prime, ptest, pminus1, val_2, val_3, result;
@ -304,6 +304,9 @@ gen_prime( unsigned nbits, int secret, int randomlevel )
if( 0 && DBG_CIPHER )
log_debug("generate a prime of %u bits ", nbits );
if (!nbits)
log_fatal ("trying to generate a prime of zero bits\n");
if( !no_of_small_prime_numbers ) {
for(i=0; small_prime_numbers[i]; i++ )
no_of_small_prime_numbers++;