Fix typo in error message.
[openssl.git] / apps / speed.c
index d865bfb5f0ccf388c8bdd6f999f226a287d22dde..e769ca2310aebde92386bf902ef158b22bdba5c3 100644 (file)
 #endif
 #ifndef NO_MD5
 #include <openssl/md5.h>
+#endif
+#ifndef NO_HMAC
 #include <openssl/hmac.h>
-#include <openssl/evp.h>
 #endif
+#include <openssl/evp.h>
 #ifndef NO_SHA
 #include <openssl/sha.h>
 #endif
@@ -239,7 +241,6 @@ static double Time_F(int s)
 int MAIN(int argc, char **argv)
        {
        unsigned char *buf=NULL,*buf2=NULL;
-       des_cblock *buf_as_des_cblock = NULL;
        int ret=1;
 #define ALGOR_NUM      14
 #define SIZE_NUM       5
@@ -286,6 +287,7 @@ int MAIN(int argc, char **argv)
                 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
        unsigned char iv[8];
 #ifndef NO_DES
+       des_cblock *buf_as_des_cblock = NULL;
        static des_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
        static des_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
        static des_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
@@ -342,6 +344,7 @@ int MAIN(int argc, char **argv)
        int pr_header=0;
 
        apps_startup();
+       memset(results, 0, sizeof(results));
 #ifndef NO_DSA
        memset(dsa_key,0,sizeof(dsa_key));
 #endif
@@ -361,7 +364,9 @@ int MAIN(int argc, char **argv)
                BIO_printf(bio_err,"out of memory\n");
                goto end;
                }
+#ifndef NO_DES
        buf_as_des_cblock = (des_cblock *)buf;
+#endif
        if ((buf2=(unsigned char *)Malloc((int)BUFSIZE)) == NULL)
                {
                BIO_printf(bio_err,"out of memory\n");
@@ -417,7 +422,7 @@ int MAIN(int argc, char **argv)
                        if (strcmp(*argv,"rc4") == 0) doit[D_RC4]=1;
                else 
 #endif
-#ifndef NO_DEF
+#ifndef NO_DES
                        if (strcmp(*argv,"des-cbc") == 0) doit[D_CBC_DES]=1;
                else    if (strcmp(*argv,"des-ede3") == 0) doit[D_EDE3_DES]=1;
                else
@@ -431,12 +436,14 @@ int MAIN(int argc, char **argv)
                        }
                else
 #endif
+#ifndef RSA_NULL
                        if (strcmp(*argv,"openssl") == 0) 
                        {
                        RSA_set_default_method(RSA_PKCS1_SSLeay());
                        j--;
                        }
                else
+#endif
 #endif /* !NO_RSA */
                     if (strcmp(*argv,"dsa512") == 0) dsa_doit[R_DSA_512]=2;
                else if (strcmp(*argv,"dsa1024") == 0) dsa_doit[R_DSA_1024]=2;
@@ -754,7 +761,7 @@ int MAIN(int argc, char **argv)
                }
 #endif
 
-#ifndef NO_MD5
+#if !defined(NO_MD5) && !defined(NO_HMAC)
        if (doit[D_HMAC])
                {
                HMAC_CTX hctx;
@@ -993,7 +1000,7 @@ int MAIN(int argc, char **argv)
                                RSA_PKCS1_PADDING);
                        if (rsa_num2 <= 0)
                                {
-                               BIO_printf(bio_err,"RSA public encrypt failure\n");
+                               BIO_printf(bio_err,"RSA public decrypt failure\n");
                                ERR_print_errors(bio_err);
                                count=1;
                                break;