int consider_randfile = (file == NULL);
char buffer[200];
-#ifdef OPENSSL_SYS_WINDOWS
- BIO_printf(bio_e,"Loading 'screen' into random state -");
- BIO_flush(bio_e);
- RAND_screen();
- BIO_printf(bio_e," done\n");
-#endif
if (file == NULL)
file = RAND_file_name(buffer, sizeof buffer);
p=in;
n=strlen(p);
-#if defined(OPENSSL_SYS_NETWARE)
- /* strip off trailing .nlm if present. */
- if ((n > 4) && (p[n-4] == '.') &&
- ((p[n-3] == 'n') || (p[n-3] == 'N')) &&
- ((p[n-2] == 'l') || (p[n-2] == 'L')) &&
- ((p[n-1] == 'm') || (p[n-1] == 'M')))
- n-=4;
-#else
/* strip off trailing .exe if present. */
if ((n > 4) && (p[n-4] == '.') &&
((p[n-3] == 'e') || (p[n-3] == 'E')) &&
((p[n-2] == 'x') || (p[n-2] == 'X')) &&
((p[n-1] == 'e') || (p[n-1] == 'E')))
n-=4;
-#endif
if (n > size-1)
n=size-1;
return (ret);
}
-#elif defined(OPENSSL_SYS_NETWARE)
-#include <time.h>
-
-double app_tminterval(int stop,int usertime)
- {
- double ret=0;
- static clock_t tmstart;
- static int warning=1;
-
- if (usertime && warning)
- {
- BIO_printf(bio_err,"To get meaningful results, run "
- "this program on idle system.\n");
- warning=0;
- }
-
- if (stop==TM_START) tmstart = clock();
- else ret = (clock()-tmstart)/(double)CLOCKS_PER_SEC;
-
- return (ret);
- }
-
#elif defined(OPENSSL_SYSTEM_VXWORKS)
#include <time.h>
#include "s_apps.h"
#include "timeouts.h"
-#if defined(OPENSSL_SYS_BEOS_R5)
-#include <fcntl.h>
-#endif
#undef PROG
#define PROG s_client_main
ENGINE *e=NULL;
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
struct timeval tv;
-#if defined(OPENSSL_SYS_BEOS_R5)
- int stdin_set = 0;
-#endif
#endif
#ifndef OPENSSL_NO_TLSEXT
char *servername = NULL;
} else i=select(width,(void *)&readfds,(void *)&writefds,
NULL,timeoutp);
}
-#elif defined(OPENSSL_SYS_NETWARE)
- if(!write_tty) {
- if(read_tty) {
- tv.tv_sec = 1;
- tv.tv_usec = 0;
- i=select(width,(void *)&readfds,(void *)&writefds,
- NULL,&tv);
- } else i=select(width,(void *)&readfds,(void *)&writefds,
- NULL,timeoutp);
- }
-#elif defined(OPENSSL_SYS_BEOS_R5)
- /* Under BeOS-R5 the situation is similar to DOS */
- i=0;
- stdin_set = 0;
- (void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
- if(!write_tty) {
- if(read_tty) {
- tv.tv_sec = 1;
- tv.tv_usec = 0;
- i=select(width,(void *)&readfds,(void *)&writefds,
- NULL,&tv);
- if (read(fileno(stdin), sbuf, 0) >= 0)
- stdin_set = 1;
- if (!i && (stdin_set != 1 || !read_tty))
- continue;
- } else i=select(width,(void *)&readfds,(void *)&writefds,
- NULL,timeoutp);
- }
- (void)fcntl(fileno(stdin), F_SETFL, 0);
#else
i=select(width,(void *)&readfds,(void *)&writefds,
NULL,timeoutp);
#else
else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
#endif
-#elif defined (OPENSSL_SYS_NETWARE)
- else if (_kbhit())
-#elif defined(OPENSSL_SYS_BEOS_R5)
- else if (stdin_set)
#else
else if (FD_ISSET(fileno(stdin),&readfds))
#endif
#define APPS_WIN16
#endif
-#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
#include <sys/types.h>
-#endif
#include <openssl/lhash.h>
#include <openssl/bn.h>
#include "s_apps.h"
#include "timeouts.h"
-#if defined(OPENSSL_SYS_BEOS_R5)
-#include <fcntl.h>
-#endif
#ifndef OPENSSL_NO_RSA
static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength);
if((i < 0) || (!i && !_kbhit() ) )continue;
if(_kbhit())
read_from_terminal = 1;
-#elif defined(OPENSSL_SYS_BEOS_R5)
- /* Under BeOS-R5 the situation is similar to DOS */
- tv.tv_sec = 1;
- tv.tv_usec = 0;
- (void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
- i=select(width,(void *)&readfds,NULL,NULL,&tv);
- if ((i < 0) || (!i && read(fileno(stdin), buf, 0) < 0))
- continue;
- if (read(fileno(stdin), buf, 0) >= 0)
- read_from_terminal = 1;
- (void)fcntl(fileno(stdin), F_SETFL, 0);
#else
if ((SSL_version(con) == DTLS1_VERSION) &&
DTLSv1_get_timeout(con, &timeout))
else
{
BIO_printf(bio_s_out,"read R BLOCK\n");
-#if defined(OPENSSL_SYS_NETWARE)
- delay(1000);
-#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
+#if !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
sleep(1);
#endif
continue;
static int init_server_long(int *sock, int port,char *ip, int type);
static int do_accept(int acc_sock, int *sock, char **host);
-#ifdef OPENSSL_SYS_WIN16
-#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
-#else
#define SOCKET_PROTOCOL IPPROTO_TCP
-#endif
#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
static int wsa_init_done=0;
#endif
-#ifdef OPENSSL_SYS_WINDOWS
-static struct WSAData wsa_state;
-static int wsa_init_done=0;
-#ifdef OPENSSL_SYS_WIN16
-static HWND topWnd=0;
-static FARPROC lpTopWndProc=NULL;
-static FARPROC lpTopHookProc=NULL;
-extern HINSTANCE _hInstance; /* nice global CRT provides */
-
-static LONG FAR PASCAL topHookProc(HWND hwnd, UINT message, WPARAM wParam,
- LPARAM lParam)
- {
- if (hwnd == topWnd)
- {
- switch(message)
- {
- case WM_DESTROY:
- case WM_CLOSE:
- SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopWndProc);
- ssl_sock_cleanup();
- break;
- }
- }
- return CallWindowProc(lpTopWndProc,hwnd,message,wParam,lParam);
- }
-
-static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
- {
- topWnd=hwnd;
- return(FALSE);
- }
-
-#endif /* OPENSSL_SYS_WIN32 */
-#endif /* OPENSSL_SYS_WINDOWS */
-
-#ifdef OPENSSL_SYS_WINDOWS
-static void ssl_sock_cleanup(void)
- {
- if (wsa_init_done)
- {
- wsa_init_done=0;
-#ifndef OPENSSL_SYS_WINCE
- WSACancelBlockingCall();
-#endif
- WSACleanup();
- }
- }
-#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
+#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
static void sock_cleanup(void)
{
if (wsa_init_done)
_watt_do_exit = 0;
if (sock_init())
return (0);
-#elif defined(OPENSSL_SYS_WINDOWS)
- if (!wsa_init_done)
- {
- int err;
-
-#ifdef SIGINT
- signal(SIGINT,(void (*)(int))ssl_sock_cleanup);
-#endif
- wsa_init_done=1;
- memset(&wsa_state,0,sizeof(wsa_state));
- if (WSAStartup(0x0101,&wsa_state)!=0)
- {
- err=WSAGetLastError();
- BIO_printf(bio_err,"unable to start WINSOCK, error code=%d\n",err);
- return(0);
- }
-
-#ifdef OPENSSL_SYS_WIN16
- EnumTaskWindows(GetCurrentTask(),enumproc,0L);
- lpTopWndProc=(FARPROC)GetWindowLong(topWnd,GWL_WNDPROC);
- lpTopHookProc=MakeProcInstance((FARPROC)topHookProc,_hInstance);
-
- SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
-#endif /* OPENSSL_SYS_WIN16 */
- }
#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
WORD wVerReq;
WSADATA wsaData;
#endif
if (bind(s,(struct sockaddr *)&server,sizeof(server)) == -1)
{
-#ifndef OPENSSL_SYS_WINDOWS
perror("bind");
-#endif
goto err;
}
/* Make it 128 for linux */
if (!ssl_sock_init()) return(0);
-#ifndef OPENSSL_SYS_WINDOWS
redoit:
-#endif
memset((char *)&from,0,sizeof(from));
len=sizeof(from);
#include "winmain.h"
#include "wintext.h"
#endif
-#if !defined(OPENSSL_SYS_MSDOS)
#include OPENSSL_UNISTD
-#endif
#undef PROG
#define PROG s_time_main
#ifdef FIONBIO
static int t_nbio=0;
#endif
-#ifdef OPENSSL_SYS_WIN32
-static int exitNow = 0; /* Set when it's time to exit main */
-#endif
static void s_time_init(void)
{
#ifdef FIONBIO
t_nbio=0;
-#endif
-#ifdef OPENSSL_SYS_WIN32
- exitNow = 0; /* Set when it's time to exit main */
#endif
}
#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
#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>