Small error fix.
[openssl.git] / apps / speed.c
index caf47e22775205bccd50525c55bb308802661e2c..b3130def8b928b0ea43d915eb39f8fe8ca58ae0c 100644 (file)
@@ -238,6 +238,8 @@ static double Time_F(int s)
 #endif
        }
 
+int MAIN(int, char **);
+
 int MAIN(int argc, char **argv)
        {
        unsigned char *buf=NULL,*buf2=NULL;
@@ -616,6 +618,7 @@ int MAIN(int argc, char **argv)
        memset(rsa_c,0,sizeof(rsa_c));
 #endif
 #ifndef SIGALRM
+#ifndef NO_DES
        BIO_printf(bio_err,"First we calculate the approximate speed ...\n");
        count=10;
        do      {
@@ -707,10 +710,14 @@ int MAIN(int argc, char **argv)
 #define COND(d)        (count < (d))
 #define COUNT(d) (d)
 #else
+/* not worth fixing */
+# error "You cannot disable DES on systems without SIGALRM."
+#endif /* NO_DES */
+#else
 #define COND(c)        (run)
 #define COUNT(d) (count)
        signal(SIGALRM,sig_done);
-#endif
+#endif /* SIGALRM */
 
 #ifndef NO_MD2
        if (doit[D_MD2])
@@ -960,7 +967,7 @@ int MAIN(int argc, char **argv)
                }
 #endif
 
-       RAND_bytes(buf,36);
+       RAND_pseudo_bytes(buf,36);
 #ifndef NO_RSA
        for (j=0; j<RSA_NUM; j++)
                {
@@ -1021,7 +1028,7 @@ int MAIN(int argc, char **argv)
                }
 #endif
 
-       RAND_bytes(buf,20);
+       RAND_pseudo_bytes(buf,20);
 #ifndef NO_DSA
        for (j=0; j<DSA_NUM; j++)
                {
@@ -1039,7 +1046,7 @@ int MAIN(int argc, char **argv)
                        {
                        rsa_num=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,
                                &kk,dsa_key[j]);
-                       if (rsa_num <= 0)
+                       if (rsa_num == 0)
                                {
                                BIO_printf(bio_err,"DSA sign failure\n");
                                ERR_print_errors(bio_err);
@@ -1062,7 +1069,7 @@ int MAIN(int argc, char **argv)
                        {
                        rsa_num2=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,
                                kk,dsa_key[j]);
-                       if (rsa_num2 <= 0)
+                       if (rsa_num2 == 0)
                                {
                                BIO_printf(bio_err,"DSA verify failure\n");
                                ERR_print_errors(bio_err);