This last one for this ticket. Removes WIN16.
So long, MS_CALLBACK and MS_FAR. We won't miss you.
Reviewed-by: Richard Levitte <levitte@openssl.org>
NCR
Tandem
Cray
+ WIN16
[Rich Salz]
*) Experimental support for a new, fast, unbiased prime candidate generator,
return(FORMAT_UNDEF);
}
-#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_NETWARE)
+#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_NETWARE)
void program_name(char *in, char *out, int size)
{
int i,n;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef OPENSSL_NO_STDIO
-#define APPS_WIN16
-#endif
#include "apps.h"
#include <openssl/err.h>
#include <openssl/ssl.h>
* -C
*/
-static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
+static int dh_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **);
}
/* dh_cb is identical to dsa_cb in apps/dsaparam.c */
-static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
+static int dh_cb(int p, int n, BN_GENCB *cb)
{
char c='*';
#endif
-static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb);
+static int dsa_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **);
OPENSSL_EXIT(ret);
}
-static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
+static int dsa_cb(int p, int n, BN_GENCB *cb)
{
char c='*';
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef OPENSSL_NO_STDIO
-#define APPS_WIN16
-#endif
#include "apps.h"
#include <openssl/err.h>
#ifndef OPENSSL_NO_ENGINE
#undef PROG
#define PROG gendh_main
-static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb);
+static int dh_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **);
OPENSSL_EXIT(ret);
}
-static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
+static int dh_cb(int p, int n, BN_GENCB *cb)
{
char c='*';
#undef PROG
#define PROG genrsa_main
-static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb);
+static int genrsa_cb(int p, int n, BN_GENCB *cb);
int MAIN(int, char **);
OPENSSL_EXIT(ret);
}
-static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb)
+static int genrsa_cb(int p, int n, BN_GENCB *cb)
{
char c='*';
EVP_MD_do_all_sorted(list_md_fn, out);
}
-static int MS_CALLBACK function_cmp(const FUNCTION *a, const FUNCTION *b)
+static int function_cmp(const FUNCTION *a, const FUNCTION *b)
{
return strncmp(a->name,b->name,8);
}
static IMPLEMENT_LHASH_COMP_FN(function, FUNCTION)
-static unsigned long MS_CALLBACK function_hash(const FUNCTION *a)
+static unsigned long function_hash(const FUNCTION *a)
{
return lh_strhash(a->name);
}
#include <stdlib.h>
#include <time.h>
#include <string.h>
-#ifdef OPENSSL_NO_STDIO
-#define APPS_WIN16
-#endif
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/evp.h>
unsigned char *context, int naccept);
#endif
#ifdef HEADER_X509_H
-int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
+int verify_callback(int ok, X509_STORE_CTX *ctx);
#endif
#ifdef HEADER_SSL_H
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
int extract_port(const char *str, short *port_ptr);
int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
-long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
+long bio_dump_callback(BIO *bio, int cmd, const char *argp,
int argi, long argl, long ret);
#ifdef HEADER_SSL_H
-void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret);
-void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
-void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
+void apps_ssl_info_callback(const SSL *s, int where, int ret);
+void msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
+void tlsext_cb(SSL *s, int client_server, int type,
unsigned char *data, int len,
void *arg);
#endif
-int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len);
-int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len);
+int generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len);
+int verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len);
typedef struct ssl_excert_st SSL_EXCERT;
unsigned char cookie_secret[COOKIE_SECRET_LENGTH];
int cookie_initialized=0;
-int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
+int verify_callback(int ok, X509_STORE_CTX *ctx)
{
X509 *err_cert;
int err,depth;
}
-long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
+long bio_dump_callback(BIO *bio, int cmd, const char *argp,
int argi, long argl, long ret)
{
BIO *out;
return(ret);
}
-void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret)
+void apps_ssl_info_callback(const SSL *s, int where, int ret)
{
const char *str;
int w;
}
}
-void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)
+void msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)
{
BIO *bio = arg;
const char *str_write_p, *str_version, *str_content_type = "", *str_details1 = "", *str_details2= "";
(void)BIO_flush(bio);
}
-void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
+void tlsext_cb(SSL *s, int client_server, int type,
unsigned char *data, int len,
void *arg)
{
(void)BIO_flush(bio);
}
-int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)
+int generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)
{
unsigned char *buffer, result[EVP_MAX_MD_SIZE];
unsigned int length, resultlength;
return 1;
}
-int MS_CALLBACK verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)
+int verify_cookie_callback(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)
{
unsigned char *buffer, result[EVP_MAX_MD_SIZE];
unsigned int length, resultlength;
#include <stdlib.h>
#include <string.h>
#include <openssl/e_os2.h>
-#ifdef OPENSSL_NO_STDIO
-#define APPS_WIN16
-#endif
-
/* With IPv6, it looks like Digital has mixed up the proper order of
recursive header file inclusion, resulting in the compiler complaining
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
} tlsextctx;
-static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg)
+static int ssl_servername_cb(SSL *s, int *ad, void *arg)
{
tlsextctx * p = (tlsextctx *) arg;
const char * hn= SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
primality tests are rather cpu consuming.
*/
-static int MS_CALLBACK ssl_srp_verify_param_cb(SSL *s, void *arg)
+static int ssl_srp_verify_param_cb(SSL *s, void *arg)
{
SRP_ARG *srp_arg = (SRP_ARG *)arg;
BIGNUM *N = NULL, *g = NULL;
#define PWD_STRLEN 1024
-static char * MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
+static char * ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
{
SRP_ARG *srp_arg = (SRP_ARG *)arg;
char *pass = (char *)OPENSSL_malloc(PWD_STRLEN+1);
#include <string.h>
#include <openssl/e_os2.h>
-#ifdef OPENSSL_NO_STDIO
-#define APPS_WIN16
-#endif
#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
#include <sys/types.h>
#endif
#ifndef OPENSSL_NO_RSA
-static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength);
+static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength);
#endif
static int not_resumable_sess_cb(SSL *s, int is_forward_secure);
static int sv_body(char *hostname, int s, int stype, unsigned char *context);
(which would normally occur after a worker has finished) and we
set the user parameters.
*/
-static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
+static int ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
{
srpsrvparm *p = (srpsrvparm *)arg;
if (p->login == NULL && p->user == NULL )
} tlsextctx;
-static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg)
+static int ssl_servername_cb(SSL *s, int *ad, void *arg)
{
tlsextctx * p = (tlsextctx *) arg;
const char * servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
}
#ifndef OPENSSL_NO_RSA
-static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
+static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength)
{
BIGNUM *bn = NULL;
static RSA *rsa_tmp=NULL;
static int do_accept_unix(int acc_sock, int *sock);
#endif
-#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
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
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;
them.sin_addr.s_addr=htonl(addr);
if (type == SOCK_STREAM)
- s=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
+ s=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
else /* ( type == SOCK_DGRAM) */
s=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
#endif
if (type == SOCK_STREAM)
- s=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
+ s=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
else /* type == SOCK_DGRAM */
s=socket(AF_INET, SOCK_DGRAM,IPPROTO_UDP);
BIO_printf(bio_err,"gethostbyname failure\n");
goto err;
}
- /* cast to short because of win16 winsock definition */
- if ((short)he->h_addrtype != AF_INET)
+ if (he->h_addrtype != AF_INET)
{
BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
return(0);
#define USE_SOCKETS
#include "apps.h"
-#ifdef OPENSSL_NO_STDIO
-#define APPS_WIN16
-#endif
#include <openssl/x509.h>
#include <openssl/ssl.h>
#include <openssl/pem.h>
static TS_RESP *create_response(CONF *conf, const char *section, char *engine,
char *queryfile, char *passin, char *inkey,
char *signer, char *chain, const char *policy);
-static ASN1_INTEGER * MS_CALLBACK serial_cb(TS_RESP_CTX *ctx, void *data);
+static ASN1_INTEGER * serial_cb(TS_RESP_CTX *ctx, void *data);
static ASN1_INTEGER *next_serial(const char *serialfile);
static int save_ts_serial(const char *serialfile, ASN1_INTEGER *serial);
char *ca_path, char *ca_file,
char *untrusted);
static X509_STORE *create_cert_store(char *ca_path, char *ca_file);
-static int MS_CALLBACK verify_cb(int ok, X509_STORE_CTX *ctx);
+static int verify_cb(int ok, X509_STORE_CTX *ctx);
/* Main function definition. */
int MAIN(int, char **);
return response;
}
-static ASN1_INTEGER * MS_CALLBACK serial_cb(TS_RESP_CTX *ctx, void *data)
+static ASN1_INTEGER * serial_cb(TS_RESP_CTX *ctx, void *data)
{
const char *serial_file = (const char *) data;
ASN1_INTEGER *serial = next_serial(serial_file);
return NULL;
}
-static int MS_CALLBACK verify_cb(int ok, X509_STORE_CTX *ctx)
+static int verify_cb(int ok, X509_STORE_CTX *ctx)
{
/*-
char buf[256];
#undef PROG
#define PROG verify_main
-static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx);
+static int cb(int ok, X509_STORE_CTX *ctx);
static int check(X509_STORE *ctx, char *file,
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
STACK_OF(X509_CRL) *crls, ENGINE *e, int show_chain);
return(ret);
}
-static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
+static int cb(int ok, X509_STORE_CTX *ctx)
{
int cert_error = X509_STORE_CTX_get_error(ctx);
X509 *current_cert = X509_STORE_CTX_get_current_cert(ctx);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef OPENSSL_NO_STDIO
-#define APPS_WIN16
-#endif
#include "apps.h"
#include <openssl/bio.h>
#include <openssl/asn1.h>
NULL
};
-static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx);
+static int callb(int ok, X509_STORE_CTX *ctx);
static int sign (X509 *x, EVP_PKEY *pkey,int days,int clrext, const EVP_MD *digest,
CONF *conf, char *section);
static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest,
return ret;
}
-static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx)
+static int callb(int ok, X509_STORE_CTX *ctx)
{
int err;
X509 *err_cert;
goto err;
}
- /* cast to short because of win16 winsock definition */
- if ((short)he->h_addrtype != AF_INET)
+ if (he->h_addrtype != AF_INET)
{
BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET);
goto err;
#include <openssl/bio.h>
#include <openssl/err.h>
-long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp,
+long BIO_debug_callback(BIO *bio, int cmd, const char *argp,
int argi, long argl, long ret)
{
BIO *b;
b=(BIO *)bio->cb_arg;
if (b != NULL)
BIO_write(b,buf,strlen(buf));
-#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16)
+#if !defined(OPENSSL_NO_STDIO)
else
fputs(buf,stderr);
#endif
#ifndef OPENSSL_NO_SOCK
-#ifdef OPENSSL_SYS_WIN16
-#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
-#else
-#define SOCKET_PROTOCOL IPPROTO_TCP
-#endif
-
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
#undef FIONBIO
#ifndef OPENSSL_NO_SOCK
-#ifdef OPENSSL_SYS_WIN16
-#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
-#else
-#define SOCKET_PROTOCOL IPPROTO_TCP
-#endif
-
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
#undef FIONBIO
c->them.sin_addr.s_addr=htonl(l);
c->state=BIO_CONN_S_CREATE_SOCKET;
- ret=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
+ ret=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if (ret == INVALID_SOCKET)
{
SYSerr(SYS_F_SOCKET,get_last_socket_error());
#if !defined(OPENSSL_NO_STDIO)
-static int MS_CALLBACK file_write(BIO *h, const char *buf, int num);
-static int MS_CALLBACK file_read(BIO *h, char *buf, int size);
-static int MS_CALLBACK file_puts(BIO *h, const char *str);
-static int MS_CALLBACK file_gets(BIO *h, char *str, int size);
-static long MS_CALLBACK file_ctrl(BIO *h, int cmd, long arg1, void *arg2);
-static int MS_CALLBACK file_new(BIO *h);
-static int MS_CALLBACK file_free(BIO *data);
+static int file_write(BIO *h, const char *buf, int num);
+static int file_read(BIO *h, char *buf, int size);
+static int file_puts(BIO *h, const char *str);
+static int file_gets(BIO *h, char *str, int size);
+static long file_ctrl(BIO *h, int cmd, long arg1, void *arg2);
+static int file_new(BIO *h);
+static int file_free(BIO *data);
static BIO_METHOD methods_filep=
{
BIO_TYPE_FILE,
return(&methods_filep);
}
-static int MS_CALLBACK file_new(BIO *bi)
+static int file_new(BIO *bi)
{
bi->init=0;
bi->num=0;
return(1);
}
-static int MS_CALLBACK file_free(BIO *a)
+static int file_free(BIO *a)
{
if (a == NULL) return(0);
if (a->shutdown)
return(1);
}
-static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
+static int file_read(BIO *b, char *out, int outl)
{
int ret=0;
return(ret);
}
-static int MS_CALLBACK file_write(BIO *b, const char *in, int inl)
+static int file_write(BIO *b, const char *in, int inl)
{
int ret=0;
return(ret);
}
-static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
+static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
{
long ret=1;
FILE *fp=(FILE *)b->ptr;
return(ret);
}
-static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size)
+static int file_gets(BIO *bp, char *buf, int size)
{
int ret=0;
return(ret);
}
-static int MS_CALLBACK file_puts(BIO *bp, const char *str)
+static int file_puts(BIO *bp, const char *str)
{
int n,ret;
#define LOG_DAEMON OPC$M_NM_NTWORK
#endif
-static int MS_CALLBACK slg_write(BIO *h, const char *buf, int num);
-static int MS_CALLBACK slg_puts(BIO *h, const char *str);
-static long MS_CALLBACK slg_ctrl(BIO *h, int cmd, long arg1, void *arg2);
-static int MS_CALLBACK slg_new(BIO *h);
-static int MS_CALLBACK slg_free(BIO *data);
+static int slg_write(BIO *h, const char *buf, int num);
+static int slg_puts(BIO *h, const char *str);
+static long slg_ctrl(BIO *h, int cmd, long arg1, void *arg2);
+static int slg_new(BIO *h);
+static int slg_free(BIO *data);
static void xopenlog(BIO* bp, char* name, int level);
static void xsyslog(BIO* bp, int priority, const char* string);
static void xcloselog(BIO* bp);
return(&methods_slg);
}
-static int MS_CALLBACK slg_new(BIO *bi)
+static int slg_new(BIO *bi)
{
bi->init=1;
bi->num=0;
return(1);
}
-static int MS_CALLBACK slg_free(BIO *a)
+static int slg_free(BIO *a)
{
if (a == NULL) return(0);
xcloselog(a);
return(1);
}
-static int MS_CALLBACK slg_write(BIO *b, const char *in, int inl)
+static int slg_write(BIO *b, const char *in, int inl)
{
int ret= inl;
char* buf;
return(ret);
}
-static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, void *ptr)
+static long slg_ctrl(BIO *b, int cmd, long num, void *ptr)
{
switch (cmd)
{
return(0);
}
-static int MS_CALLBACK slg_puts(BIO *bp, const char *str)
+static int slg_puts(BIO *bp, const char *str)
{
int n,ret;
bn_div_words_abort(int i)
{
#ifdef BN_DEBUG
-#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16)
+#if !defined(OPENSSL_NO_STDIO)
fprintf(stderr,"Division would overflow (%d)\n",i);
#endif
abort();
#include "cryptlib.h"
#include <openssl/safestack.h>
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
+#if defined(OPENSSL_SYS_WIN32)
static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
#endif
#include <stdlib.h>
#include <openssl/e_os2.h>
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_WINDOWS)
+#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINDOWS)
#ifndef OPENSSL_SYS_MSDOS
#define OPENSSL_SYS_MSDOS
#endif
/* #define SIGACTION */ /* Define this if you have sigaction() */
-#ifdef WIN16TTY
-#undef OPENSSL_SYS_WIN16
-#undef _WINDOWS
-#include <graph.h>
-#endif
-
/* 06-Apr-92 Luke Brennan Support for VMS */
#include "des_locl.h"
#include "cryptlib.h"
static void recsig(int);
static void pushsig(void);
static void popsig(void);
-#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN16)
+#if defined(OPENSSL_SYS_MSDOS)
static int noecho_fgets(char *buf, int size, FILE *tty);
#endif
#ifdef SIGACTION
return(0);
}
-#elif defined(OPENSSL_SYS_WIN16)
-
-int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify)
- {
- memset(buf,0,size);
- memset(buff,0,size);
- return(0);
- }
-
-#else /* !OPENSSL_SYS_WINCE && !OPENSSL_SYS_WIN16 */
+#else /* !OPENSSL_SYS_WINCE */
static void read_till_nl(FILE *in)
{
break;
}
size--;
-#ifdef WIN16TTY
- i=_inchar();
-#else
i=getch();
-#endif
if (i == '\r') i='\n';
*(p++)=i;
if (i == '\n')
return(strlen(buf));
}
#endif
-#endif /* !OPENSSL_SYS_WINCE && !WIN16 */
+#endif /* !OPENSSL_SYS_WINCE */
#else
#include <openssl/dh.h>
-#ifdef OPENSSL_SYS_WIN16
-#define MS_CALLBACK _far _loadds
-#else
-#define MS_CALLBACK
-#endif
-
-static int MS_CALLBACK cb(int p, int n, BN_GENCB *arg);
+static int cb(int p, int n, BN_GENCB *arg);
static const char rnd_seed[] = "string to make the random number generator think it has entropy";
return(ret);
}
-static int MS_CALLBACK cb(int p, int n, BN_GENCB *arg)
+static int cb(int p, int n, BN_GENCB *arg)
{
char c='*';
#else
#include <openssl/dsa.h>
-#ifdef OPENSSL_SYS_WIN16
-#define MS_CALLBACK _far _loadds
-#else
-#define MS_CALLBACK
-#endif
-
-static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *arg);
+static int dsa_cb(int p, int n, BN_GENCB *arg);
/* seed, out_p, out_q, out_g are taken from the updated Appendix 5 to
* FIPS PUB 186 and also appear in Appendix 5 to FIPS PIB 186-1 */
return(0);
}
-static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *arg)
+static int dsa_cb(int p, int n, BN_GENCB *arg)
{
char c='*';
static int ok=0,num=0;
#include <openssl/ec.h>
#include <openssl/ecdh.h>
-#ifdef OPENSSL_SYS_WIN16
-#define MS_CALLBACK _far _loadds
-#else
-#define MS_CALLBACK
-#endif
-
#if 0
-static void MS_CALLBACK cb(int p, int n, void *arg);
+static void cb(int p, int n, void *arg);
#endif
static const char rnd_seed[] = "string to make the random number generator think it has entropy";
}
#if 0
-static void MS_CALLBACK cb(int p, int n, void *arg)
+static void cb(int p, int n, void *arg)
{
char c='*';
#include "cryptlib.h"
#include <openssl/safestack.h>
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
+#if defined(OPENSSL_SYS_WIN32)
static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
#endif
static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL;
-static void (MS_FAR *locking_callback)(int mode,int type,
+static void (*locking_callback)(int mode,int type,
const char *file,int line)=0;
-static int (MS_FAR *add_lock_callback)(int *pointer,int amount,
+static int (*add_lock_callback)(int *pointer,int amount,
int type,const char *file,int line)=0;
-static struct CRYPTO_dynlock_value *(MS_FAR *dynlock_create_callback)
+static struct CRYPTO_dynlock_value *(*dynlock_create_callback)
(const char *file,int line)=0;
-static void (MS_FAR *dynlock_lock_callback)(int mode,
+static void (*dynlock_lock_callback)(int mode,
struct CRYPTO_dynlock_value *l, const char *file,int line)=0;
-static void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l,
+static void (*dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l,
const char *file,int line)=0;
int CRYPTO_get_new_lockid(char *name)
char *str;
int i;
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
+#if defined(OPENSSL_SYS_WIN32)
/* A hack to make Visual C++ 5.0 work correctly when linking as
* a DLL using /MT. Without this, the application cannot use
* any floating point printf's.
(sigtype == NID_md2WithRSAEncryption)))
{
/* ok, we will let it through */
-#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16)
+#if !defined(OPENSSL_NO_STDIO)
fprintf(stderr,"signature has problems, re-make with post SSLeay045\n");
#endif
}
#include "cryptlib.h"
#ifndef OPENSSL_NO_DEPRECATED
-static unsigned long (MS_FAR *id_callback)(void)=0;
+static unsigned long (*id_callback)(void)=0;
#endif
-static void (MS_FAR *threadid_callback)(CRYPTO_THREADID *)=0;
+static void (*threadid_callback)(CRYPTO_THREADID *)=0;
/* the memset() here and in set_pointer() seem overkill, but for the sake of
* CRYPTO_THREADID_cmp() this avoids any platform silliness that might cause two
}
#endif
/* Else pick a backup */
-#ifdef OPENSSL_SYS_WIN16
- CRYPTO_THREADID_set_numeric(id, (unsigned long)GetCurrentTask());
-#elif defined(OPENSSL_SYS_WIN32)
+#if defined(OPENSSL_SYS_WIN32)
CRYPTO_THREADID_set_numeric(id, (unsigned long)GetCurrentThreadId());
#else
/* For everything else, default to using the address of 'errno' */
if (id_callback == NULL)
{
-#ifdef OPENSSL_SYS_WIN16
- ret=(unsigned long)GetCurrentTask();
-#elif defined(OPENSSL_SYS_WIN32)
+#if defined(OPENSSL_SYS_WIN32)
ret=(unsigned long)GetCurrentThreadId();
#elif defined(GETPID_IS_MEANINGLESS)
ret=1L;
#include <openssl/rand.h>
#ifdef OPENSSL_NO_FP_API
-#define APPS_WIN16
#include "../buffer/bss_file.c"
#endif
*(p++)='\0';
if ((n != num) || (*f != '\0'))
{
-#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporary fix :-( */
+#if !defined(OPENSSL_NO_STDIO) /* temporary fix :-( */
fprintf(stderr,"wrong number of fields on line %ld (looking for field %d, got %d, '%s' left)\n",ln,num,n,f);
#endif
er=2;
pp[n]=p;
if (!sk_OPENSSL_PSTRING_push(ret->data,pp))
{
-#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporary fix :-( */
+#if !defined(OPENSSL_NO_STDIO) /* temporary fix :-( */
fprintf(stderr,"failure in sk_push\n");
#endif
er=2;
BUF_MEM_free(buf);
if (er)
{
-#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16)
+#if !defined(OPENSSL_NO_STDIO)
if (er == 1) fprintf(stderr,"OPENSSL_malloc failure\n");
#endif
if (ret != NULL)
# endif
#endif
-#ifdef WIN16TTY
-# undef OPENSSL_SYS_WIN16
-# undef WIN16
-# undef _WINDOWS
-# include <graph.h>
-#endif
-
/* 06-Apr-92 Luke Brennan Support for VMS */
#include "ui_locl.h"
#include "cryptlib.h"
static int is_a_tty;
/* Declare static functions */
-#if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE)
+#if !defined(OPENSSL_SYS_WINCE)
static int read_till_nl(FILE *);
static void recsig(int);
static void pushsig(void);
static void popsig(void);
#endif
-#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN16)
+#if defined(OPENSSL_SYS_MSDOS)
static int noecho_fgets(char *buf, int size, FILE *tty);
#endif
static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl);
}
-#if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE)
+#if !defined(OPENSSL_SYS_WINCE)
/* Internal functions to read a string without echoing */
static int read_till_nl(FILE *in)
{
int ok;
char result[BUFSIZ];
int maxsize = BUFSIZ-1;
-#if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE)
+#if !defined(OPENSSL_SYS_WINCE)
char *p;
intr_signal=0;
}
-#if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE)
+#if !defined(OPENSSL_SYS_WINCE)
/* Internal functions to handle signals and act on them */
static void pushsig(void)
{
#endif
/* Internal functions specific for Windows */
-#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE)
+#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WINCE)
static int noecho_fgets(char *buf, int size, FILE *tty)
{
int i;
break;
}
size--;
-#ifdef WIN16TTY
- i=_inchar();
-#elif defined(_WIN32)
+#if defined(_WIN32)
i=_getch();
#else
i=getch();
return(0);
}
-#ifdef WIN16
-# define MS_CALLBACK _far _loadds
-# define MS_FAR _far
-#else
-# define MS_CALLBACK
-# define MS_FAR
-#endif
-
-static void MS_CALLBACK callback(p, n, arg)
+static void callback(p, n, arg)
int p;
int n;
void *arg;
#define writesocket(s,b,n) write((s),(b),(n))
#endif
-#ifdef WIN16 /* never the case */
-# define MS_CALLBACK _far _loadds
-# define MS_FAR _far
-#else
-# define MS_CALLBACK
-# define MS_FAR
-#endif
-
#ifdef OPENSSL_NO_STDIO
# undef OPENSSL_NO_FP_API
# define OPENSSL_NO_FP_API
s->s3->previous_server_finished_len=i;
}
-#ifdef OPENSSL_SYS_WIN16
- /* MSVC 1.5 does not clear the top bytes of the word unless
- * I do this.
- */
- l&=0xffff;
-#endif
ssl_set_handshake_header(s, SSL3_MT_FINISHED, l);
s->state=b;
}
}
#ifndef OPENSSL_NO_SRP
-static char * MS_CALLBACK srp_password_from_info_cb(SSL *s, void *arg)
+static char * srp_password_from_info_cb(SSL *s, void *arg)
{
return BUF_strdup(s->srp_ctx.info) ;
}
return ctx->cert->sec_ex;
}
-#if defined(_WINDLL) && defined(OPENSSL_SYS_WIN16)
-#include "../crypto/bio/bss_file.c"
-#endif
-
IMPLEMENT_STACK_OF(SSL_CIPHER)
IMPLEMENT_STACK_OF(SSL_COMP)
IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(SSL_CIPHER, SSL_CIPHER,
#define COMP_RLE 255
#define COMP_ZLIB 1
-static int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
+static int verify_callback(int ok, X509_STORE_CTX *ctx);
#ifndef OPENSSL_NO_RSA
-static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export,int keylength);
+static RSA *tmp_rsa_cb(SSL *s, int is_export,int keylength);
static void free_tmp_rsa(void);
#endif
-static int MS_CALLBACK app_verify_callback(X509_STORE_CTX *ctx, void *arg);
+static int app_verify_callback(X509_STORE_CTX *ctx, void *arg);
#define APP_CALLBACK_STRING "Test Callback Argument"
struct app_verify_arg
{
#define PWD_STRLEN 1024
-static char * MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
+static char * ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
{
SRP_CLIENT_ARG *srp_client_arg = (SRP_CLIENT_ARG *)arg;
return BUF_strdup((char *)srp_client_arg->srppassin);
char *pass;
} SRP_SERVER_ARG;
-static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
+static int ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
{
SRP_SERVER_ARG * p = (SRP_SERVER_ARG *) arg;
return idx;
}
-static int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
+static int verify_callback(int ok, X509_STORE_CTX *ctx)
{
char *s,buf[256];
return process_proxy_cond_adders(letters, cond, cond_end, &pos, 1);
}
-static int MS_CALLBACK app_verify_callback(X509_STORE_CTX *ctx, void *arg)
+static int app_verify_callback(X509_STORE_CTX *ctx, void *arg)
{
int ok=1;
struct app_verify_arg *cb_arg = arg;
#ifndef OPENSSL_NO_RSA
static RSA *rsa_tmp=NULL;
-static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
+static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength)
{
BIGNUM *bn = NULL;
if (rsa_tmp == NULL)
my $VMSNonVAX=0;
my $VMS=0;
my $W32=0;
-my $W16=0;
my $NT=0;
my $OS2=0;
# Set this to make typesafe STACK definitions appear in DEF
my @known_platforms = ( "__FreeBSD__", "PERL5",
"EXPORT_VAR_AS_FUNCTION", "ZLIB",
"OPENSSL_FIPS", "OPENSSL_FIPSCAPABLE" );
-my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" );
+my @known_ossl_platforms = ( "VMS", "WIN32", "WINNT", "OS2" );
my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
"CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1",
"SHA256", "SHA512", "RIPEMD",
{
$debug=1 if $_ eq "debug";
$W32=1 if $_ eq "32";
- $W16=1 if $_ eq "16";
+ die "win16 not supported" if $_ eq "16";
if($_ eq "NT") {
$W32 = 1;
$NT = 1;
}
# If no platform is given, assume WIN32
-if ($W32 + $W16 + $VMS + $OS2 == 0) {
+if ($W32 + $VMS + $OS2 == 0) {
$W32 = 1;
}
-# Add extra knowledge
-if ($W16) {
- $no_fp_api=1;
-}
-
if (!$do_ssl && !$do_crypto)
{
print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT | OS2 ]\n";
} elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_rw_const\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
$def .=
"#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
+ .join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_read_$1(void);";
$def .= "int PEM_write_$1(void);";
} elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_write_const\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
$def .=
"#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
+ .join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_write_$1(void);";
$def .=
next;
} elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
$def .=
"#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
+ .join(',',@current_platforms).":"
.join(',',@current_algorithms).";";
$def .= "int PEM_read_$1(void);";
$def .=
# Prune the returned symbols
delete $syms{"bn_dump1"};
- $platform{"BIO_s_log"} .= ",!WIN32,!WIN16,!macintosh";
+ $platform{"BIO_s_log"} .= ",!WIN32,!macintosh";
$platform{"PEM_read_NS_CERT_SEQ"} = "VMS";
$platform{"PEM_write_NS_CERT_SEQ"} = "VMS";
if ($keyword eq "VMSNonVAX" && $VMSNonVAX) { return 1; }
if ($keyword eq "VMS" && $VMS) { return 1; }
if ($keyword eq "WIN32" && $W32) { return 1; }
- if ($keyword eq "WIN16" && $W16) { return 1; }
if ($keyword eq "WINNT" && $NT) { return 1; }
if ($keyword eq "OS2" && $OS2) { return 1; }
# Special platforms:
# EXPORT_VAR_AS_FUNCTION means that global variables
# will be represented as functions. This currently
# only happens on VMS-VAX.
- if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) {
+ if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32)) {
return 1;
}
if ($keyword eq "OPENSSL_FIPSCAPABLE") {
if ($W32)
{ $libname.="32"; }
- elsif ($W16)
- { $libname.="16"; }
elsif ($OS2)
{ # DLL names should not clash on the whole system.
# However, they should not have any particular relationship
EOF
- if ($W16) {
- print <<"EOF";
-CODE PRELOAD MOVEABLE
-DATA PRELOAD MOVEABLE SINGLE
-
-EXETYPE WINDOWS
-
-HEAPSIZE 4096
-STACKSIZE 8192
-
-EOF
- }
-
print "EXPORTS\n";
(@e)=grep(/^SSLeay(\{[0-9]+\})?\\.*?:.*?:FUNCTION/,@symbols);