Do a favor to those who get weird compiles and report if RAND_pseudo_bytes
authorRichard Levitte <levitte@openssl.org>
Tue, 10 Oct 2000 15:08:30 +0000 (15:08 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 10 Oct 2000 15:08:30 +0000 (15:08 +0000)
returns -1...

crypto/rand/randtest.c

index da96e3f..b64de61 100644 (file)
@@ -73,7 +73,13 @@ int main()
        /*double d; */
        long d;
 
-       RAND_pseudo_bytes(buf,2500);
+       i = RAND_pseudo_bytes(buf,2500);
+       if (i < 0)
+               {
+               printf ("init failed, the rand method is not properly installed\n");
+               err++;
+               goto err;
+               }
 
        n1=0;
        for (i=0; i<16; i++) n2[i]=0;
@@ -201,6 +207,7 @@ int main()
                err++;
                }
        printf("test 4 done\n");
+ err:
        err=((err)?1:0);
        exit(err);
        return(err);