diff options
-rw-r--r-- | apps/progs.h | 2 | ||||
-rw-r--r-- | apps/progs.pl | 2 | ||||
-rw-r--r-- | apps/speed.c | 1194 | ||||
-rw-r--r-- | crypto/asn1/asn1.h | 10 | ||||
-rw-r--r-- | crypto/bn/bn_print.c | 2 | ||||
-rw-r--r-- | crypto/dh/dh.h | 8 | ||||
-rw-r--r-- | crypto/dsa/dsa.h | 6 | ||||
-rw-r--r-- | crypto/ec/ec.h | 4 | ||||
-rw-r--r-- | crypto/err/err.c | 2 | ||||
-rw-r--r-- | crypto/err/err.h | 12 | ||||
-rw-r--r-- | crypto/err/err_all.c | 2 | ||||
-rw-r--r-- | crypto/evp/evp.h | 13 | ||||
-rw-r--r-- | crypto/lhash/lh_stats.c | 79 | ||||
-rw-r--r-- | crypto/lhash/lhash.c | 9 | ||||
-rw-r--r-- | crypto/lhash/lhash.h | 14 | ||||
-rw-r--r-- | crypto/objects/obj_dat.c | 15 | ||||
-rw-r--r-- | crypto/pem/pem.h | 24 | ||||
-rw-r--r-- | crypto/rsa/rsa.h | 6 | ||||
-rw-r--r-- | crypto/ts/ts.h | 12 | ||||
-rw-r--r-- | crypto/ts/ts_asn1.c | 8 | ||||
-rw-r--r-- | crypto/txt_db/txt_db.h | 9 | ||||
-rw-r--r-- | crypto/x509/x509.h | 26 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.c | 4 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.h | 4 | ||||
-rw-r--r-- | ssl/ssl.h | 24 | ||||
-rw-r--r-- | ssl/ssl_cert.c | 6 | ||||
-rw-r--r-- | ssl/ssltest.c | 2 |
27 files changed, 616 insertions, 883 deletions
diff --git a/apps/progs.h b/apps/progs.h index 5eb974b23d..c66da3036b 100644 --- a/apps/progs.h +++ b/apps/progs.h @@ -113,9 +113,7 @@ FUNCTION functions[] = { #if !defined(OPENSSL_NO_SOCK) {FUNC_TYPE_GENERAL, "s_client", s_client_main}, #endif -#ifndef OPENSSL_NO_SPEED {FUNC_TYPE_GENERAL, "speed", speed_main}, -#endif #if !defined(OPENSSL_NO_SOCK) {FUNC_TYPE_GENERAL, "s_time", s_time_main}, #endif diff --git a/apps/progs.pl b/apps/progs.pl index 2b1efd8fed..8695742f28 100644 --- a/apps/progs.pl +++ b/apps/progs.pl @@ -33,8 +33,6 @@ foreach (@ARGV) $str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n"; if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/)) { print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n"; } - elsif ( ($_ =~ /^speed$/)) - { print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; } elsif ( ($_ =~ /^engine$/)) { print "#ifndef OPENSSL_NO_ENGINE\n${str}#endif\n"; } elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) || ($_ =~ /^rsautl$/)) diff --git a/apps/speed.c b/apps/speed.c index 1b4d23b4e8..f5af9a345e 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -69,147 +69,140 @@ * */ -/* most of this code has been pilfered from my libdes speed.c program */ - -#ifndef OPENSSL_NO_SPEED - -# undef SECONDS -# define SECONDS 3 -# define PRIME_SECONDS 10 -# define RSA_SECONDS 10 -# define DSA_SECONDS 10 -# define ECDSA_SECONDS 10 -# define ECDH_SECONDS 10 - -/* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ -/* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ - -# undef PROG -# define PROG speed_main - -# include <stdio.h> -# include <stdlib.h> - -# include <string.h> -# include <math.h> -# include "apps.h" -# include <openssl/crypto.h> -# include <openssl/rand.h> -# include <openssl/err.h> -# include <openssl/evp.h> -# include <openssl/objects.h> -# if !defined(OPENSSL_SYS_MSDOS) -# include OPENSSL_UNISTD -# endif +#undef SECONDS +#define SECONDS 3 +#define PRIME_SECONDS 10 +#define RSA_SECONDS 10 +#define DSA_SECONDS 10 +#define ECDSA_SECONDS 10 +#define ECDH_SECONDS 10 + +#undef PROG +#define PROG speed_main + +#include <stdio.h> +#include <stdlib.h> + +#include <string.h> +#include <math.h> +#include "apps.h" +#include <openssl/crypto.h> +#include <openssl/rand.h> +#include <openssl/err.h> +#include <openssl/evp.h> +#include <openssl/objects.h> +#if !defined(OPENSSL_SYS_MSDOS) +# include OPENSSL_UNISTD +#endif -# ifndef OPENSSL_SYS_NETWARE -# include <signal.h> -# endif +#ifndef OPENSSL_SYS_NETWARE +# include <signal.h> +#endif -# if defined(_WIN32) || defined(__CYGWIN__) -# include <windows.h> -# if defined(__CYGWIN__) && !defined(_WIN32) +#if defined(_WIN32) || defined(__CYGWIN__) +# include <windows.h> +# if defined(__CYGWIN__) && !defined(_WIN32) /* * <windows.h> should define _WIN32, which normally is mutually exclusive * with __CYGWIN__, but if it didn't... */ -# define _WIN32 +# define _WIN32 /* this is done because Cygwin alarm() fails sometimes. */ -# endif -# endif - -# include <openssl/bn.h> -# ifndef OPENSSL_NO_DES -# include <openssl/des.h> -# endif -# ifndef OPENSSL_NO_AES -# include <openssl/aes.h> -# endif -# ifndef OPENSSL_NO_CAMELLIA -# include <openssl/camellia.h> -# endif -# ifndef OPENSSL_NO_MD2 -# include <openssl/md2.h> -# endif -# ifndef OPENSSL_NO_MDC2 -# include <openssl/mdc2.h> -# endif -# ifndef OPENSSL_NO_MD4 -# include <openssl/md4.h> -# endif -# ifndef OPENSSL_NO_MD5 -# include <openssl/md5.h> -# endif -# ifndef OPENSSL_NO_HMAC -# include <openssl/hmac.h> -# endif -# include <openssl/evp.h> -# ifndef OPENSSL_NO_SHA -# include <openssl/sha.h> -# endif -# ifndef OPENSSL_NO_RMD160 -# include <openssl/ripemd.h> -# endif -# ifndef OPENSSL_NO_WHIRLPOOL -# include <openssl/whrlpool.h> -# endif -# ifndef OPENSSL_NO_RC4 -# include <openssl/rc4.h> -# endif -# ifndef OPENSSL_NO_RC5 -# include <openssl/rc5.h> -# endif -# ifndef OPENSSL_NO_RC2 -# include <openssl/rc2.h> -# endif -# ifndef OPENSSL_NO_IDEA -# include <openssl/idea.h> -# endif -# ifndef OPENSSL_NO_SEED -# include <openssl/seed.h> -# endif -# ifndef OPENSSL_NO_BF -# include <openssl/blowfish.h> -# endif -# ifndef OPENSSL_NO_CAST -# include <openssl/cast.h> -# endif -# ifndef OPENSSL_NO_RSA -# include <openssl/rsa.h> -# include "./testrsa.h" -# endif -# include <openssl/x509.h> -# ifndef OPENSSL_NO_DSA -# include <openssl/dsa.h> -# include "./testdsa.h" -# endif -# ifndef OPENSSL_NO_ECDSA -# include <openssl/ecdsa.h> # endif -# ifndef OPENSSL_NO_ECDH -# include <openssl/ecdh.h> -# endif -# include <openssl/modes.h> +#endif -# include <openssl/bn.h> +#include <openssl/bn.h> +#ifndef OPENSSL_NO_DES +# include <openssl/des.h> +#endif +#ifndef OPENSSL_NO_AES +# include <openssl/aes.h> +#endif +#ifndef OPENSSL_NO_CAMELLIA +# include <openssl/camellia.h> +#endif +#ifndef OPENSSL_NO_MD2 +# include <openssl/md2.h> +#endif +#ifndef OPENSSL_NO_MDC2 +# include <openssl/mdc2.h> +#endif +#ifndef OPENSSL_NO_MD4 +# include <openssl/md4.h> +#endif +#ifndef OPENSSL_NO_MD5 +# include <openssl/md5.h> +#endif +#ifndef OPENSSL_NO_HMAC +# include <openssl/hmac.h> +#endif +#include <openssl/evp.h> +#ifndef OPENSSL_NO_SHA +# include <openssl/sha.h> +#endif +#ifndef OPENSSL_NO_RMD160 +# include <openssl/ripemd.h> +#endif +#ifndef OPENSSL_NO_WHIRLPOOL +# include <openssl/whrlpool.h> +#endif +#ifndef OPENSSL_NO_RC4 +# include <openssl/rc4.h> +#endif +#ifndef OPENSSL_NO_RC5 +# include <openssl/rc5.h> +#endif +#ifndef OPENSSL_NO_RC2 +# include <openssl/rc2.h> +#endif +#ifndef OPENSSL_NO_IDEA +# include <openssl/idea.h> +#endif +#ifndef OPENSSL_NO_SEED +# include <openssl/seed.h> +#endif +#ifndef OPENSSL_NO_BF +# include <openssl/blowfish.h> +#endif +#ifndef OPENSSL_NO_CAST +# include <openssl/cast.h> +#endif +#ifndef OPENSSL_NO_RSA +# include <openssl/rsa.h> +# include "./testrsa.h" +#endif +#include <openssl/x509.h> +#ifndef OPENSSL_NO_DSA +# include <openssl/dsa.h> +# include "./testdsa.h" +#endif +#ifndef OPENSSL_NO_ECDSA +# include <openssl/ecdsa.h> +#endif +#ifndef OPENSSL_NO_ECDH +# include <openssl/ecdh.h> +#endif +#include <openssl/modes.h> -# ifndef HAVE_FORK -# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE) -# define HAVE_FORK 0 -# else -# define HAVE_FORK 1 -# endif -# endif +#include <openssl/bn.h> -# if HAVE_FORK -# undef NO_FORK +#ifndef HAVE_FORK +# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE) +# define HAVE_FORK 0 # else -# define NO_FORK +# define HAVE_FORK 1 # endif +#endif -# undef BUFSIZE -# define BUFSIZE (1024*8+1) -# define MAX_MISALIGNMENT 63 +#if HAVE_FORK +# undef NO_FORK +#else +# define NO_FORK +#endif + +#undef BUFSIZE +#define BUFSIZE (1024*8+1) +#define MAX_MISALIGNMENT 63 static volatile int run = 0; @@ -221,18 +214,18 @@ static void print_message(const char *s, long num, int length); static void pkey_print_message(const char *str, const char *str2, long num, int bits, int sec); static void print_result(int alg, int run_no, int count, double time_used); -# ifndef NO_FORK +#ifndef NO_FORK static int do_multi(int multi); -# endif +#endif -# define ALGOR_NUM 30 -# define SIZE_NUM 5 -# define PRIME_NUM 3 -# define RSA_NUM 7 -# define DSA_NUM 3 +#define ALGOR_NUM 30 +#define SIZE_NUM 5 +#define PRIME_NUM 3 +#define RSA_NUM 7 +#define DSA_NUM 3 -# define EC_NUM 16 -# define MAX_ECDH_SIZE 256 +#define EC_NUM 16 +#define MAX_ECDH_SIZE 256 static const char *names[ALGOR_NUM] = { "md2", "mdc2", "md4", "md5", "hmac(md5)", "sha1", "rmd160", "rc4", @@ -247,31 +240,31 @@ static const char *names[ALGOR_NUM] = { static double results[ALGOR_NUM][SIZE_NUM]; static int lengths[SIZE_NUM] = { 16, 64, 256, 1024, 8 * 1024 }; -# ifndef OPENSSL_NO_RSA +#ifndef OPENSSL_NO_RSA static double rsa_results[RSA_NUM][2]; -# endif -# ifndef OPENSSL_NO_DSA +#endif +#ifndef OPENSSL_NO_DSA static double dsa_results[DSA_NUM][2]; -# endif -# ifndef OPENSSL_NO_ECDSA +#endif +#ifndef OPENSSL_NO_ECDSA static double ecdsa_results[EC_NUM][2]; -# endif -# ifndef OPENSSL_NO_ECDH +#endif +#ifndef OPENSSL_NO_ECDH static double ecdh_results[EC_NUM][1]; -# endif +#endif -# if defined(OPENSSL_NO_DSA) && !(defined(OPENSSL_NO_ECDSA) && defined(OPENSSL_NO_ECDH)) +#if defined(OPENSSL_NO_DSA) && !(defined(OPENSSL_NO_ECDSA) && defined(OPENSSL_NO_ECDH)) static const char rnd_seed[] = "string to make the random number generator think it has entropy"; static int rnd_fake = 0; -# endif +#endif -# ifdef SIGALRM -# if defined(__STDC__) || defined(sgi) || defined(_AIX) -# define SIGRETTYPE void -# else -# define SIGRETTYPE int -# endif +#ifdef SIGALRM +# if defined(__STDC__) || defined(sgi) || defined(_AIX) +# define SIGRETTYPE void +# else +# define SIGRETTYPE int +# endif static SIGRETTYPE sig_done(int sig); static SIGRETTYPE sig_done(int sig) @@ -279,23 +272,23 @@ static SIGRETTYPE sig_done(int sig) signal(SIGALRM, sig_done); run = 0; } -# endif +#endif -# define START 0 -# define STOP 1 +#define START 0 +#define STOP 1 -# if defined(_WIN32) +#if defined(_WIN32) -# if !defined(SIGALRM) -# define SIGALRM -# endif +# if !defined(SIGALRM) +# define SIGALRM +# endif static unsigned int lapse, schlock; static void alarm_win32(unsigned int secs) { lapse = secs * 1000; } -# define alarm alarm_win32 +# define alarm alarm_win32 static DWORD WINAPI sleepy(VOID * arg) { @@ -330,7 +323,7 @@ static double Time_F(int s) return ret; } -# else +#else static double Time_F(int s) { @@ -339,24 +332,24 @@ static double Time_F(int s) alarm(0); return ret; } -# endif +#endif -# ifndef OPENSSL_NO_ECDH +#ifndef OPENSSL_NO_ECDH static const int KDF1_SHA1_len = 20; static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen) { -# ifndef OPENSSL_NO_SHA +# ifndef OPENSSL_NO_SHA if (*outlen < SHA_DIGEST_LENGTH) return NULL; else *outlen = SHA_DIGEST_LENGTH; return SHA1(in, inlen, out); -# else +# else return NULL; -# endif /* OPENSSL_NO_SHA */ +# endif /* OPENSSL_NO_SHA */ } -# endif /* OPENSSL_NO_ECDH */ +#endif /* OPENSSL_NO_ECDH */ static void multiblock_speed(const EVP_CIPHER *evp_cipher); @@ -369,67 +362,67 @@ int MAIN(int argc, char **argv) int mret = 1; long count = 0, save_count = 0; int i, j, k; -# if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) +#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) long rsa_count; -# endif -# ifndef OPENSSL_NO_RSA +#endif +#ifndef OPENSSL_NO_RSA unsigned rsa_num; -# endif +#endif unsigned char md[EVP_MAX_MD_SIZE]; -# ifndef OPENSSL_NO_MD2 +#ifndef OPENSSL_NO_MD2 unsigned char md2[MD2_DIGEST_LENGTH]; -# endif -# ifndef OPENSSL_NO_MDC2 +#endif +#ifndef OPENSSL_NO_MDC2 unsigned char mdc2[MDC2_DIGEST_LENGTH]; -# endif -# ifndef OPENSSL_NO_MD4 +#endif +#ifndef OPENSSL_NO_MD4 unsigned char md4[MD4_DIGEST_LENGTH]; -# endif -# ifndef OPENSSL_NO_MD5 +#endif +#ifndef OPENSSL_NO_MD5 unsigned char md5[MD5_DIGEST_LENGTH]; unsigned char hmac[MD5_DIGEST_LENGTH]; -# endif -# ifndef OPENSSL_NO_SHA +#endif +#ifndef OPENSSL_NO_SHA unsigned char sha[SHA_DIGEST_LENGTH]; -# ifndef OPENSSL_NO_SHA256 +# ifndef OPENSSL_NO_SHA256 unsigned char sha256[SHA256_DIGEST_LENGTH]; -# endif -# ifndef OPENSSL_NO_SHA512 +# endif +# ifndef OPENSSL_NO_SHA512 unsigned char sha512[SHA512_DIGEST_LENGTH]; -# endif # endif -# ifndef OPENSSL_NO_WHIRLPOOL +#endif +#ifndef OPENSSL_NO_WHIRLPOOL unsigned char whirlpool[WHIRLPOOL_DIGEST_LENGTH]; -# endif -# ifndef OPENSSL_NO_RMD160 +#endif +#ifndef OPENSSL_NO_RMD160 unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; -# endif -# ifndef OPENSSL_NO_RC4 +#endif +#ifndef OPENSSL_NO_RC4 RC4_KEY rc4_ks; -# endif -# ifndef OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_NO_RC5 RC5_32_KEY rc5_ks; -# endif -# ifndef OPENSSL_NO_RC2 +#endif +#ifndef OPENSSL_NO_RC2 RC2_KEY rc2_ks; -# endif -# ifndef OPENSSL_NO_IDEA +#endif +#ifndef OPENSSL_NO_IDEA IDEA_KEY_SCHEDULE idea_ks; -# endif -# ifndef OPENSSL_NO_SEED +#endif +#ifndef OPENSSL_NO_SEED SEED_KEY_SCHEDULE seed_ks; -# endif -# ifndef OPENSSL_NO_BF +#endif +#ifndef OPENSSL_NO_BF BF_KEY bf_ks; -# endif -# ifndef OPENSSL_NO_CAST +#endif +#ifndef OPENSSL_NO_CAST CAST_KEY cast_ks; -# endif +#endif static const unsigned char key16[16] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12 }; -# ifndef OPENSSL_NO_AES +#ifndef OPENSSL_NO_AES static const unsigned char key24[24] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, @@ -441,8 +434,8 @@ int MAIN(int argc, char **argv) 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56 }; -# endif -# ifndef OPENSSL_NO_CAMELLIA +#endif +#ifndef OPENSSL_NO_CAMELLIA static const unsigned char ckey24[24] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, @@ -454,15 +447,15 @@ int MAIN(int argc, char **argv) 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56 }; -# endif -# ifndef OPENSSL_NO_AES -# define MAX_BLOCK_SIZE 128 -# else -# define MAX_BLOCK_SIZE 64 -# endif +#endif +#ifndef OPENSSL_NO_AES +# define MAX_BLOCK_SIZE 128 +#else +# define MAX_BLOCK_SIZE 64 +#endif unsigned char DES_iv[8]; unsigned char iv[2 * MAX_BLOCK_SIZE / 8]; -# ifndef OPENSSL_NO_DES +#ifndef OPENSSL_NO_DES static DES_cblock key = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 }; static DES_cblock key2 = @@ -472,77 +465,77 @@ int MAIN(int argc, char **argv) DES_key_schedule sch; DES_key_schedule sch2; DES_key_schedule sch3; -# endif -# ifndef OPENSSL_NO_AES +#endif +#ifndef OPENSSL_NO_AES AES_KEY aes_ks1, aes_ks2, aes_ks3; -# endif -# ifndef OPENSSL_NO_CAMELLIA +#endif +#ifndef OPENSSL_NO_CAMELLIA CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3; -# endif -# define D_MD2 0 -# define D_MDC2 1 -# define D_MD4 2 -# define D_MD5 3 -# define D_HMAC 4 -# define D_SHA1 5 -# define D_RMD160 6 -# define D_RC4 7 -# define D_CBC_DES 8 -# define D_EDE3_DES 9 -# define D_CBC_IDEA 10 -# define D_CBC_SEED 11 -# define D_CBC_RC2 12 -# define D_CBC_RC5 13 -# define D_CBC_BF 14 -# define D_CBC_CAST 15 -# define D_CBC_128_AES 16 -# define D_CBC_192_AES 17 -# define D_CBC_256_AES 18 -# define D_CBC_128_CML 19 -# define D_CBC_192_CML 20 -# define D_CBC_256_CML 21 -# define D_EVP 22 -# define D_SHA256 23 -# define D_SHA512 24 -# define D_WHIRLPOOL 25 -# define D_IGE_128_AES 26 -# define D_IGE_192_AES 27 -# define D_IGE_256_AES 28 -# define D_GHASH 29 +#endif +#define D_MD2 0 +#define D_MDC2 1 +#define D_MD4 2 +#define D_MD5 3 +#define D_HMAC 4 +#define D_SHA1 5 +#define D_RMD160 6 +#define D_RC4 7 +#define D_CBC_DES 8 +#define D_EDE3_DES 9 +#define D_CBC_IDEA 10 +#define D_CBC_SEED 11 +#define D_CBC_RC2 12 +#define D_CBC_RC5 13 +#define D_CBC_BF 14 +#define D_CBC_CAST 15 +#define D_CBC_128_AES 16 +#define D_CBC_192_AES 17 +#define D_CBC_256_AES 18 +#define D_CBC_128_CML 19 +#define D_CBC_192_CML 20 +#define D_CBC_256_CML 21 +#define D_EVP 22 +#define D_SHA256 23 +#define D_SHA512 24 +#define D_WHIRLPOOL 25 +#define D_IGE_128_AES 26 +#define D_IGE_192_AES 27 +#define D_IGE_256_AES 28 +#define D_GHASH 29 double d = 0.0; long c[ALGOR_NUM][SIZE_NUM]; -# ifndef OPENSSL_SYS_WIN32 -# endif -# define R_DSA_512 0 -# define R_DSA_1024 1 -# define R_DSA_2048 2 -# define R_RSA_512 0 -# define R_RSA_1024 1 -# define R_RSA_2048 2 -# define R_RSA_3072 3 -# define R_RSA_4096 4 -# define R_RSA_7680 5 -# define R_RSA_15360 6 - -# define R_EC_P160 0 -# define R_EC_P192 1 -# define R_EC_P224 2 -# define R_EC_P256 3 -# define R_EC_P384 4 -# define R_EC_P521 5 -# define R_EC_K163 6 -# define R_EC_K233 7 -# define R_EC_K283 8 -# define R_EC_K409 9 -# define R_EC_K571 10 -# define R_EC_B163 11 -# define R_EC_B233 12 -# define R_EC_B283 13 -# define R_EC_B409 14 -# define R_EC_B571 15 - -# ifndef OPENSSL_NO_RSA +#ifndef OPENSSL_SYS_WIN32 +#endif +#define R_DSA_512 0 +#define R_DSA_1024 1 +#define R_DSA_2048 2 +#define R_RSA_512 0 +#define R_RSA_1024 1 +#define R_RSA_2048 2 +#define R_RSA_3072 3 +#define R_RSA_4096 4 +#define R_RSA_7680 5 +#define R_RSA_15360 6 + +#define R_EC_P160 0 +#define R_EC_P192 1 +#define R_EC_P224 2 +#define R_EC_P256 3 +#define R_EC_P384 4 +#define R_EC_P521 5 +#define R_EC_K163 6 +#define R_EC_K233 7 +#define R_EC_K283 8 +#define R_EC_K409 9 +#define R_EC_K571 10 +#define R_EC_B163 11 +#define R_EC_B233 12 +#define R_EC_B283 13 +#define R_EC_B409 14 +#define R_EC_B571 15 + +#ifndef OPENSSL_NO_RSA RSA *rsa_key[RSA_NUM]; long rsa_c[RSA_NUM][2]; static unsigned int rsa_bits[RSA_NUM] = { @@ -557,13 +550,13 @@ int MAIN(int argc, char **argv) sizeof(test4096), sizeof(test7680), sizeof(test15360) }; -# endif -# ifndef OPENSSL_NO_DSA +#endif +#ifndef OPENSSL_NO_DSA DSA *dsa_key[DSA_NUM]; long dsa_c[DSA_NUM][2]; static unsigned int dsa_bits[DSA_NUM] = { 512, 1024, 2048 }; -# endif -# ifndef OPENSSL_NO_EC +#endif +#ifndef OPENSSL_NO_EC /* * We only test over the following curves as they are representative, To * add tests over more curves, simply add the curve NID and curve name to @@ -615,62 +608,62 @@ int MAIN(int argc, char **argv) 163, 233, 283, 409, 571 }; -# endif +#endif -# ifndef OPENSSL_NO_ECDSA +#ifndef OPENSSL_NO_ECDSA unsigned char ecdsasig[256]; unsigned int ecdsasiglen; EC_KEY *ecdsa[EC_NUM]; long ecdsa_c[EC_NUM][2]; -# endif +#endif -# ifndef OPENSSL_NO_ECDH +#ifndef OPENSSL_NO_ECDH EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM]; unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE]; int secret_size_a, secret_size_b; int ecdh_checks = 0; int secret_idx = 0; long ecdh_c[EC_NUM][2]; -# endif +#endif int rsa_doit[RSA_NUM]; int dsa_doit[DSA_NUM]; -# ifndef OPENSSL_NO_ECDSA +#ifndef OPENSSL_NO_ECDSA int ecdsa_doit[EC_NUM]; -# endif -# ifndef OPENSSL_NO_ECDH +#endif +#ifndef OPENSSL_NO_ECDH int ecdh_doit[EC_NUM]; -# endif +#endif int doit[ALGOR_NUM]; int pr_header = 0; const EVP_CIPHER *evp_cipher = NULL; const EVP_MD *evp_md = NULL; int decrypt = 0; -# ifndef NO_FORK +#ifndef NO_FORK int multi = 0; -# endif +#endif int multiblock = 0; int misalign = MAX_MISALIGNMENT + 1; -# ifndef TIMES +#ifndef TIMES usertime = -1; -# endif +#endif apps_startup(); memset(results, 0, sizeof(results)); -# ifndef OPENSSL_NO_DSA +#ifndef OPENSSL_NO_DSA memset(dsa_key, 0, sizeof(dsa_key)); -# endif -# ifndef OPENSSL_NO_ECDSA +#endif +#ifndef OPENSSL_NO_ECDSA for (i = 0; i < EC_NUM; i++) ecdsa[i] = NULL; -# endif -# ifndef OPENSSL_NO_ECDH +#endif +#ifndef OPENSSL_NO_ECDH for (i = 0; i < EC_NUM; i++) { ecdh_a[i] = NULL; ecdh_b[i] = NULL; } -# endif +#endif if (bio_err == NULL) if ((bio_err = BIO_new(BIO_s_file())) != NULL) @@ -679,11 +672,11 @@ int MAIN(int argc, char **argv) if (!load_config(bio_err, NULL)) goto end; -# ifndef OPENSSL_NO_RSA +#ifndef OPENSSL_NO_RSA memset(rsa_key, 0, sizeof(rsa_key)); for (i = 0; i < RSA_NUM; i++) rsa_key[i] = NULL; -# endif +#endif if ((buf_malloc = (unsigned char *)OPENSSL_malloc(BUFSIZE + misalign)) == NULL) { @@ -711,14 +704,14 @@ int MAIN(int argc, char **argv) rsa_doit[i] = 0; for (i = 0; i < DSA_NUM; i++) dsa_doit[i] = 0; -# ifndef OPENSSL_NO_ECDSA +#ifndef OPENSSL_NO_ECDSA for (i = 0; i < EC_NUM; i++) ecdsa_doit[i] = 0; -# endif -# ifndef OPENSSL_NO_ECDH +#endif +#ifndef OPENSSL_NO_ECDH for (i = 0; i < EC_NUM; i++) ecdh_doit[i] = 0; -# endif +#endif j = 0; argc--; @@ -750,7 +743,7 @@ int MAIN(int argc, char **argv) j--; /* Otherwise, -elapsed gets confused with an * algorithm. */ } -# ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE else if ((argc > 0) && (strcmp(*argv, "-engine") == 0)) { argc--; argv++; @@ -766,8 +759,8 @@ int MAIN(int argc, char **argv) */ j--; } -# endif -# ifndef NO_FORK +#endif +#ifndef NO_FORK else if ((argc > 0) && (strcmp(*argv, "-multi") == 0)) { argc--; argv++; @@ -783,7 +776,7 @@ int MAIN(int argc, char **argv) j--; /* Otherwise, -mr gets confused with an * algorithm. */ } -# endif +#endif else if (argc > 0 && !strcmp(*argv, "-mr")) { mr = 1; j--; /* Otherwise, -mr gets confused with an @@ -809,54 +802,54 @@ int MAIN(int argc, char **argv) buf2 = buf2_malloc + misalign; j--; } else -# ifndef OPENSSL_NO_MD2 +#ifndef OPENSSL_NO_MD2 if (strcmp(*argv, "md2") == 0) doit[D_MD2] = 1; else -# endif -# ifndef OPENSSL_NO_MDC2 +#endif +#ifndef OPENSSL_NO_MDC2 if (strcmp(*argv, "mdc2") == 0) doit[D_MDC2] = 1; else -# endif -# ifndef OPENSSL_NO_MD4 +#endif +#ifndef OPENSSL_NO_MD4 if (strcmp(*argv, "md4") == 0) doit[D_MD4] = 1; else -# endif -# ifndef OPENSSL_NO_MD5 +#endif +#ifndef OPENSSL_NO_MD5 if (strcmp(*argv, "md5") == 0) doit[D_MD5] = 1; else -# endif -# ifndef OPENSSL_NO_MD5 +#endif +#ifndef OPENSSL_NO_MD5 if (strcmp(*argv, "hmac") == 0) doit[D_HMAC] = 1; else -# endif -# ifndef OPENSSL_NO_SHA +#endif +#ifndef OPENSSL_NO_SHA if (strcmp(*argv, "sha1") == 0) doit[D_SHA1] = 1; else if (strcmp(*argv, "sha") == 0) doit[D_SHA1] = 1, doit[D_SHA256] = 1, doit[D_SHA512] = 1; else -# ifndef OPENSSL_NO_SHA256 +# ifndef OPENSSL_NO_SHA256 if (strcmp(*argv, "sha256") == 0) doit[D_SHA256] = 1; else -# endif -# ifndef OPENSSL_NO_SHA512 +# endif +# ifndef OPENSSL_NO_SHA512 if (strcmp(*argv, "sha512") == 0) doit[D_SHA512] = 1; else -# endif # endif -# ifndef OPENSSL_NO_WHIRLPOOL +#endif +#ifndef OPENSSL_NO_WHIRLPOOL if (strcmp(*argv, "whirlpool") == 0) doit[D_WHIRLPOOL] = 1; else -# endif -# ifndef OPENSSL_NO_RMD160 +#endif +#ifndef OPENSSL_NO_RMD160 if (strcmp(*argv, "ripemd") == 0) doit[D_RMD160] = 1; else if (strcmp(*argv, "rmd160") == 0) @@ -864,20 +857,20 @@ int MAIN(int argc, char **argv) else if (strcmp(*argv, "ripemd160") == 0) doit[D_RMD160] = 1; else -# endif -# ifndef OPENSSL_NO_RC4 +#endif +#ifndef OPENSSL_NO_RC4 if (strcmp(*argv, "rc4") == 0) doit[D_RC4] = 1; else -# endif -# ifndef OPENSSL_NO_DES +#endif +#ifndef OPENSSL_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 -# endif -# ifndef OPENSSL_NO_AES +#endif +#ifndef OPENSSL_NO_AES if (strcmp(*argv, "aes-128-cbc") == 0) doit[D_CBC_128_AES] = 1; else if (strcmp(*argv, "aes-192-cbc") == 0) @@ -891,8 +884,8 @@ int MAIN(int argc, char **argv) else if (strcmp(*argv, "aes-256-ige") == 0) doit[D_IGE_256_AES] = 1; else -# endif -# ifndef OPENSSL_NO_CAMELLIA +#endif +#ifndef OPENSSL_NO_CAMELLIA if (strcmp(*argv, "camellia-128-cbc") == 0) doit[D_CBC_128_CML] = 1; else if (strcmp(*argv, "camellia-192-cbc") == 0) |