1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

* POTFILES.in (cipher/primegen.c): Added.

* primegen.c (gen_prime): Bail out if we try to generate a prime
with less than 16 bits.
This commit is contained in:
Werner Koch 2003-10-10 09:19:52 +00:00
parent 240923a492
commit 66716c7349
4 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2003-10-10 Werner Koch <wk@gnupg.org>
* primegen.c (gen_prime): Bail out if we try to generate a prime
with less than 16 bits.
2003-10-06 Werner Koch <wk@gnupg.org> 2003-10-06 Werner Koch <wk@gnupg.org>
* primegen.c (gen_prime): Bail out if NBITS is zero. This is * primegen.c (gen_prime): Bail out if NBITS is zero. This is

View File

@ -31,6 +31,7 @@
#include "util.h" #include "util.h"
#include "mpi.h" #include "mpi.h"
#include "cipher.h" #include "cipher.h"
#include "i18n.h"
static int no_of_small_prime_numbers; static int no_of_small_prime_numbers;
static MPI gen_prime( unsigned nbits, int mode, int randomlevel ); static MPI gen_prime( unsigned nbits, int mode, int randomlevel );
@ -304,8 +305,11 @@ gen_prime( unsigned nbits, int secret, int randomlevel )
if( 0 && DBG_CIPHER ) if( 0 && DBG_CIPHER )
log_debug("generate a prime of %u bits ", nbits ); log_debug("generate a prime of %u bits ", nbits );
if (!nbits) if (nbits < 16)
log_fatal ("trying to generate a prime of zero bits\n"); {
log_error (_("can't generate a prime with less than %d bits\n"), 16);
exit (2);
}
if( !no_of_small_prime_numbers ) { if( !no_of_small_prime_numbers ) {
for(i=0; small_prime_numbers[i]; i++ ) for(i=0; small_prime_numbers[i]; i++ )

View File

@ -1,3 +1,7 @@
2003-10-10 Werner Koch <wk@gnupg.org>
* POTFILES.in (cipher/primegen.c): Added.
2003-08-21 Werner Koch <wk@gnupg.org> 2003-08-21 Werner Koch <wk@gnupg.org>
* pl.po, hu.po: Updated from upstream. * pl.po, hu.po: Updated from upstream.

View File

@ -13,6 +13,7 @@ cipher/random.c
cipher/rndlinux.c cipher/rndlinux.c
cipher/md.c cipher/md.c
cipher/rndegd.c cipher/rndegd.c
cipher/primegen.c
# main program # main program
g10/g10.c g10/g10.c