#include <openssl/ecdh.h>
#endif
-#if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
-# define NO_FORK 1
-#elif HAVE_FORK
-# undef NO_FORK
+#ifndef HAVE_FORK
+# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE)
+# define HAVE_FORK 0
+# else
+# define HAVE_FORK 1
+# endif
+#endif
+
+#if HAVE_FORK
+#undef NO_FORK
#else
-# define NO_FORK 1
-#endef
+#define NO_FORK
+#endif
#undef BUFSIZE
#define BUFSIZE ((long)1024*8+1)
"aes-128 ige","aes-192 ige","aes-256 ige"};
static double results[ALGOR_NUM][SIZE_NUM];
static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
+#ifndef OPENSSL_NO_RSA
static double rsa_results[RSA_NUM][2];
+#endif
+#ifndef OPENSSL_NO_DSA
static double dsa_results[DSA_NUM][2];
+#endif
#ifndef OPENSSL_NO_ECDSA
static double ecdsa_results[EC_NUM][2];
#endif
static double Time_F(int s)
{
+ double ret;
+ static HANDLE thr;
+
if (s == START)
{
- HANDLE thr;
schlock = 0;
thr = CreateThread(NULL,4096,sleepy,NULL,0,NULL);
if (thr==NULL)
BIO_printf(bio_err,"unable to CreateThread (%d)",ret);
ExitProcess(ret);
}
- CloseHandle(thr); /* detach the thread */
while (!schlock) Sleep(0); /* scheduler spinlock */
+ ret = app_tminterval(s,usertime);
+ }
+ else
+ {
+ ret = app_tminterval(s,usertime);
+ if (run) TerminateThread(thr,0);
+ CloseHandle(thr);
}
- return app_tminterval(s,usertime);
+ return ret;
}
#else
static double Time_F(int s)
{
- return app_tminterval(s,usertime);
+ double ret = app_tminterval(s,usertime);
+ if (s == STOP) alarm(0);
+ return ret;
}
#endif
# error "You cannot disable DES on systems without SIGALRM."
#endif /* OPENSSL_NO_DES */
#else
-#define COND(c) (run)
+#define COND(c) (run && count<0x7fffffff)
#define COUNT(d) (count)
#ifndef _WIN32
signal(SIGALRM,sig_done);