Header for RAND_seed()
[openssl.git] / crypto / dh / dhtest.c
index 687ce71611aef5caee3719c68ba2a4b40ac6d033..d66c28455ec01211adf6b6b3af2eb400f361d0fc 100644 (file)
@@ -65,6 +65,7 @@
 #include <openssl/crypto.h>
 #include <openssl/bio.h>
 #include <openssl/bn.h>
+#include <openssl/rand.h>
 
 #ifdef NO_DH
 int main(int argc, char *argv[])
@@ -87,9 +88,12 @@ static void MS_CALLBACK cb(int p, int n, void *arg);
 #include "bss_file.c"
 #endif
 
+static const char rnd_seed[] = "string to make the random number generator think it has entropy";
+
 int main(int argc, char *argv[])
        {
-       DH *a,*b;
+       DH *a;
+       DH *b=NULL;
        char buf[12];
        unsigned char *abuf=NULL,*bbuf=NULL;
        int i,alen,blen,aout,bout,ret=1;
@@ -99,6 +103,8 @@ int main(int argc, char *argv[])
        CRYPTO_malloc_init();
 #endif
 
+       RAND_seed(rnd_seed, sizeof rnd_seed);
+
        out=BIO_new(BIO_s_file());
        if (out == NULL) exit(1);
        BIO_set_fp(out,stdout,BIO_NOCLOSE);