aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'cipher/random.c')
-rw-r--r--cipher/random.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cipher/random.c b/cipher/random.c
index d80b870b4..78c9ecdaa 100644
--- a/cipher/random.c
+++ b/cipher/random.c
@@ -46,7 +46,6 @@
#include <sys/resource.h>
#endif
#include "g10lib.h"
-#include "util.h"
#include "rmd.h"
#include "ttyio.h"
#include "random.h"
@@ -463,14 +462,20 @@ gather_faked( void (*add)(const void*, size_t, int), int requester,
if( !initialized ) {
log_info(_("WARNING: using insecure random number generator!!\n"));
+ /* we can't use tty_printf here - do we need this function at
+ all - does it really make sense or canit be viewed as a potential
+ security problem ? wk 17.11.99 */
+ #warning Extended warning disabled
+ #if 0
tty_printf(_("The random number generator is only a kludge to let\n"
"it run - it is in no way a strong RNG!\n\n"
"DON'T USE ANY DATA GENERATED BY THIS PROGRAM!!\n\n"));
+ #endif
initialized=1;
#ifdef HAVE_RAND
- srand(make_timestamp()*getpid());
+ srand( time(NULL) * getpid());
#else
- srandom(make_timestamp()*getpid());
+ srandom( time(NULL) * getpid());
#endif
}