1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

version 0.2.1

This commit is contained in:
Werner Koch 1998-01-28 16:09:43 +00:00
parent 3d637328c9
commit 9bf8ce27bc
35 changed files with 714 additions and 274 deletions

View file

@ -31,6 +31,7 @@
#include "util.h"
#include "cipher.h"
#include "ttyio.h"
#include "i18n.h"
struct cache {
int len;
@ -51,7 +52,11 @@ quick_random_gen( int onoff )
int last = quick_test;
if( onoff != -1 )
quick_test = onoff;
#ifdef HAVE_DEV_RANDOM
return last;
#else
return 1; /* insecure RNG */
#endif
}
@ -137,9 +142,9 @@ fill_buffer( byte *buffer, size_t length, int level )
tv.tv_usec = 0;
if( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) ) {
if( !warn )
tty_printf(
tty_printf( _(
"\nNot enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need %d more bytes)\n", length );
the OS a chance to collect more entropy! (Need %d more bytes)\n"), length );
warn = 1;
continue;
}
@ -177,10 +182,10 @@ fill_buffer( byte *buffer, size_t length, int level )
static int initialized=0;
if( !initialized ) {
log_info("warning: using insecure random number generator!!\n");
tty_printf("The random number generator is only a kludge to let\n"
log_info(_("warning: using insecure random number generator!!\n"));
tty_printf(_("The random number generator is only a kludge to let\n"
"it compile - it is in no way a strong RNG!\n\n"
"DON'T USE ANY DATA GENERATED BY THIS PROGRAM!!\n\n");
"DON'T USE ANY DATA GENERATED BY THIS PROGRAM!!\n\n"));
initialized=1;
#ifdef HAVE_RAND
srand(make_timestamp()*getpid());