From 6d23cf97443bfedf755341b4f2d0d7fce254e020 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 12 Jan 2015 17:29:26 -0500 Subject: [PATCH] RT3548: Remove unsupported platforms This last one for this ticket. Removes WIN16. So long, MS_CALLBACK and MS_FAR. We won't miss you. Reviewed-by: Richard Levitte --- CHANGES | 1 + apps/apps.c | 2 +- apps/ciphers.c | 3 --- apps/dhparam.c | 4 ++-- apps/dsaparam.c | 4 ++-- apps/engine.c | 3 --- apps/gendh.c | 4 ++-- apps/genrsa.c | 4 ++-- apps/openssl.c | 4 ++-- apps/req.c | 3 --- apps/s_apps.h | 14 +++++------ apps/s_cb.c | 14 +++++------ apps/s_client.c | 10 +++----- apps/s_server.c | 11 ++++----- apps/s_socket.c | 51 +++-------------------------------------- apps/s_time.c | 3 --- apps/ts.c | 8 +++---- apps/verify.c | 4 ++-- apps/x509.c | 7 ++---- crypto/bio/b_sock.c | 3 +-- crypto/bio/bio_cb.c | 4 ++-- crypto/bio/bss_acpt.c | 6 ----- crypto/bio/bss_conn.c | 8 +------ crypto/bio/bss_file.c | 28 +++++++++++----------- crypto/bio/bss_log.c | 20 ++++++++-------- crypto/bn/vms-helper.c | 2 +- crypto/cryptlib.c | 2 +- crypto/des/destest.c | 2 +- crypto/des/read_pwd.c | 25 +++----------------- crypto/dh/dhtest.c | 10 ++------ crypto/dsa/dsatest.c | 10 ++------ crypto/ecdh/ecdhtest.c | 10 ++------ crypto/lock.c | 14 +++++------ crypto/rsa/rsa_sign.c | 2 +- crypto/thr_id.c | 12 ++++------ crypto/threads/mttest.c | 1 - crypto/txt_db/txt_db.c | 6 ++--- crypto/ui/ui_openssl.c | 23 ++++++------------- demos/selfsign.c | 10 +------- e_os.h | 8 ------- ssl/s3_both.c | 6 ----- ssl/s3_lib.c | 2 +- ssl/ssl_lib.c | 4 ---- ssl/ssltest.c | 16 ++++++------- util/mkdef.pl | 41 +++++++-------------------------- 45 files changed, 124 insertions(+), 305 deletions(-) diff --git a/CHANGES b/CHANGES index f697f3e90e..685f98c501 100644 --- a/CHANGES +++ b/CHANGES @@ -37,6 +37,7 @@ NCR Tandem Cray + WIN16 [Rich Salz] *) Experimental support for a new, fast, unbiased prime candidate generator, diff --git a/apps/apps.c b/apps/apps.c index 80762c1cc0..ac709a6a3d 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -290,7 +290,7 @@ int str2fmt(char *s) 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; diff --git a/apps/ciphers.c b/apps/ciphers.c index 7de7dd3b38..0018360018 100644 --- a/apps/ciphers.c +++ b/apps/ciphers.c @@ -59,9 +59,6 @@ #include #include #include -#ifdef OPENSSL_NO_STDIO -#define APPS_WIN16 -#endif #include "apps.h" #include #include diff --git a/apps/dhparam.c b/apps/dhparam.c index 7982222abc..86bf19d861 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -144,7 +144,7 @@ * -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 **); @@ -551,7 +551,7 @@ end: } /* 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='*'; diff --git a/apps/dsaparam.c b/apps/dsaparam.c index a922335c31..7a9ed82e75 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -101,7 +101,7 @@ static void timebomb_sigalarm(int foo) #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 **); @@ -468,7 +468,7 @@ end: 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='*'; diff --git a/apps/engine.c b/apps/engine.c index 9a0294398e..04d4f73cd4 100644 --- a/apps/engine.c +++ b/apps/engine.c @@ -60,9 +60,6 @@ #include #include #include -#ifdef OPENSSL_NO_STDIO -#define APPS_WIN16 -#endif #include "apps.h" #include #ifndef OPENSSL_NO_ENGINE diff --git a/apps/gendh.c b/apps/gendh.c index 4581bfac70..ec6842528a 100644 --- a/apps/gendh.c +++ b/apps/gendh.c @@ -77,7 +77,7 @@ #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 **); @@ -218,7 +218,7 @@ end: 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='*'; diff --git a/apps/genrsa.c b/apps/genrsa.c index fe00af9bd2..b0bba054cd 100644 --- a/apps/genrsa.c +++ b/apps/genrsa.c @@ -77,7 +77,7 @@ #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 **); @@ -312,7 +312,7 @@ err: 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='*'; diff --git a/apps/openssl.c b/apps/openssl.c index 7453e6528c..c438dafaff 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -698,13 +698,13 @@ static void list_md(BIO *out) 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); } diff --git a/apps/req.c b/apps/req.c index 686fac4f5d..e23c9197a5 100644 --- a/apps/req.c +++ b/apps/req.c @@ -60,9 +60,6 @@ #include #include #include -#ifdef OPENSSL_NO_STDIO -#define APPS_WIN16 -#endif #include "apps.h" #include #include diff --git a/apps/s_apps.h b/apps/s_apps.h index 9d16e45978..625e1eb266 100644 --- a/apps/s_apps.h +++ b/apps/s_apps.h @@ -157,7 +157,7 @@ int do_server_unix(const char *path, int *ret, 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); @@ -176,19 +176,19 @@ int should_retry(int i); 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; diff --git a/apps/s_cb.c b/apps/s_cb.c index 7720144d59..758da231be 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -135,7 +135,7 @@ int verify_return_error=0; 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; @@ -557,7 +557,7 @@ int ssl_print_tmp_key(BIO *out, SSL *s) } -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; @@ -581,7 +581,7 @@ long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp, 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; @@ -638,7 +638,7 @@ static const char *ssl_version_str(int version) } } -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= ""; @@ -868,7 +868,7 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void * (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) { @@ -981,7 +981,7 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type, (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; @@ -1069,7 +1069,7 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, unsign 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; diff --git a/apps/s_client.c b/apps/s_client.c index d650cc40ce..199a587dcb 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -141,10 +141,6 @@ #include #include #include -#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 @@ -384,7 +380,7 @@ typedef struct tlsextctx_st { } 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); @@ -454,7 +450,7 @@ static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g) 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; @@ -489,7 +485,7 @@ static int MS_CALLBACK ssl_srp_verify_param_cb(SSL *s, void *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_ARG *srp_arg = (SRP_ARG *)arg; char *pass = (char *)OPENSSL_malloc(PWD_STRLEN+1); diff --git a/apps/s_server.c b/apps/s_server.c index 6690646c8c..412091dd11 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -148,9 +148,6 @@ #include #include -#ifdef OPENSSL_NO_STDIO -#define APPS_WIN16 -#endif #if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */ #include @@ -193,7 +190,7 @@ typedef unsigned int u_int; #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); @@ -367,7 +364,7 @@ typedef struct srpsrvparm_st (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 ) @@ -721,7 +718,7 @@ typedef struct tlsextctx_st { } 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); @@ -3411,7 +3408,7 @@ err: } #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; diff --git a/apps/s_socket.c b/apps/s_socket.c index f44050db40..397cb1effc 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -107,12 +107,6 @@ static int init_server_unix(int *sock, const char *path); 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 @@ -121,36 +115,6 @@ static int wsa_init_done=0; 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 @@ -199,14 +163,6 @@ static int ssl_sock_init(void) 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; @@ -263,7 +219,7 @@ static int init_client_ip(int *sock, const unsigned char ip[4], int port, 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); @@ -412,7 +368,7 @@ static int init_server_long(int *sock, int port, char *ip, int type) #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); @@ -667,8 +623,7 @@ static int host_ip(const char *str, unsigned char ip[4]) 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); diff --git a/apps/s_time.c b/apps/s_time.c index 6542be2827..dfe8df70fa 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -69,9 +69,6 @@ #define USE_SOCKETS #include "apps.h" -#ifdef OPENSSL_NO_STDIO -#define APPS_WIN16 -#endif #include #include #include diff --git a/apps/ts.c b/apps/ts.c index ace13bdddb..2a1d666406 100644 --- a/apps/ts.c +++ b/apps/ts.c @@ -103,7 +103,7 @@ static TS_RESP *read_PKCS7(BIO *in_bio); 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); @@ -116,7 +116,7 @@ static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest, 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 **); @@ -876,7 +876,7 @@ static TS_RESP *create_response(CONF *conf, const char *section, char *engine, 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); @@ -1128,7 +1128,7 @@ static X509_STORE *create_cert_store(char *ca_path, char *ca_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]; diff --git a/apps/verify.c b/apps/verify.c index b9480bd812..2b2224f516 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -69,7 +69,7 @@ #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); @@ -342,7 +342,7 @@ end: 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); diff --git a/apps/x509.c b/apps/x509.c index 3bb261010f..b3c23907bf 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -60,9 +60,6 @@ #include #include #include -#ifdef OPENSSL_NO_STDIO -#define APPS_WIN16 -#endif #include "apps.h" #include #include @@ -156,7 +153,7 @@ static const char *x509_usage[]={ 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, @@ -1279,7 +1276,7 @@ end: 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; diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index f13d2ac4b9..f7e95ee5c5 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -150,8 +150,7 @@ int BIO_get_host_ip(const char *str, unsigned char *ip) 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; diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c index 9bcbc321d9..dd21d02468 100644 --- a/crypto/bio/bio_cb.c +++ b/crypto/bio/bio_cb.c @@ -63,7 +63,7 @@ #include #include -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; @@ -135,7 +135,7 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp, 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 diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 0237c0fbc6..1dd6776695 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -64,12 +64,6 @@ #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 diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index d2c9695b70..511660427f 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -64,12 +64,6 @@ #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 @@ -209,7 +203,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c) 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()); diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index b954fe7ebc..4a4e747bc7 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -95,13 +95,13 @@ #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, @@ -202,7 +202,7 @@ BIO_METHOD *BIO_s_file(void) return(&methods_filep); } -static int MS_CALLBACK file_new(BIO *bi) +static int file_new(BIO *bi) { bi->init=0; bi->num=0; @@ -211,7 +211,7 @@ static int MS_CALLBACK file_new(BIO *bi) return(1); } -static int MS_CALLBACK file_free(BIO *a) +static int file_free(BIO *a) { if (a == NULL) return(0); if (a->shutdown) @@ -230,7 +230,7 @@ static int MS_CALLBACK file_free(BIO *a) 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; @@ -250,7 +250,7 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl) 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; @@ -270,7 +270,7 @@ static int MS_CALLBACK file_write(BIO *b, const char *in, int inl) 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; @@ -440,7 +440,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *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; @@ -461,7 +461,7 @@ static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size) 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; diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index 2227b2b52d..1cc413a916 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -122,11 +122,11 @@ #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); @@ -149,7 +149,7 @@ BIO_METHOD *BIO_s_log(void) return(&methods_slg); } -static int MS_CALLBACK slg_new(BIO *bi) +static int slg_new(BIO *bi) { bi->init=1; bi->num=0; @@ -158,14 +158,14 @@ static int MS_CALLBACK slg_new(BIO *bi) 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; @@ -218,7 +218,7 @@ static int MS_CALLBACK slg_write(BIO *b, const char *in, int inl) 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) { @@ -232,7 +232,7 @@ static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, void *ptr) 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; diff --git a/crypto/bn/vms-helper.c b/crypto/bn/vms-helper.c index 4b63149bf3..ca6e5ba2e0 100644 --- a/crypto/bn/vms-helper.c +++ b/crypto/bn/vms-helper.c @@ -60,7 +60,7 @@ 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(); diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 07f68e684e..00cb337835 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -117,7 +117,7 @@ #include "cryptlib.h" #include -#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 diff --git a/crypto/des/destest.c b/crypto/des/destest.c index 31e01561b4..2cbfdb5f44 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -60,7 +60,7 @@ #include #include -#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 diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c index 9ad8f51f2d..f5f10266a6 100644 --- a/crypto/des/read_pwd.c +++ b/crypto/des/read_pwd.c @@ -77,12 +77,6 @@ /* #define SIGACTION */ /* Define this if you have sigaction() */ -#ifdef WIN16TTY -#undef OPENSSL_SYS_WIN16 -#undef _WINDOWS -#include -#endif - /* 06-Apr-92 Luke Brennan Support for VMS */ #include "des_locl.h" #include "cryptlib.h" @@ -195,7 +189,7 @@ static void read_till_nl(FILE *); 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 @@ -225,16 +219,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt, int verify) 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) { @@ -473,11 +458,7 @@ static int noecho_fgets(char *buf, int size, FILE *tty) break; } size--; -#ifdef WIN16TTY - i=_inchar(); -#else i=getch(); -#endif if (i == '\r') i='\n'; *(p++)=i; if (i == '\n') @@ -501,4 +482,4 @@ static int noecho_fgets(char *buf, int size, FILE *tty) return(strlen(buf)); } #endif -#endif /* !OPENSSL_SYS_WINCE && !WIN16 */ +#endif /* !OPENSSL_SYS_WINCE */ diff --git a/crypto/dh/dhtest.c b/crypto/dh/dhtest.c index f4c2fd9cea..7452afbb5e 100644 --- a/crypto/dh/dhtest.c +++ b/crypto/dh/dhtest.c @@ -77,13 +77,7 @@ int main(int argc, char *argv[]) #else #include -#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"; @@ -210,7 +204,7 @@ err: 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='*'; diff --git a/crypto/dsa/dsatest.c b/crypto/dsa/dsatest.c index 152205f1c0..2dac421970 100644 --- a/crypto/dsa/dsatest.c +++ b/crypto/dsa/dsatest.c @@ -79,13 +79,7 @@ int main(int argc, char *argv[]) #else #include -#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 */ @@ -235,7 +229,7 @@ end: 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; diff --git a/crypto/ecdh/ecdhtest.c b/crypto/ecdh/ecdhtest.c index e4c09455f1..30c3596caf 100644 --- a/crypto/ecdh/ecdhtest.c +++ b/crypto/ecdh/ecdhtest.c @@ -92,14 +92,8 @@ int main(int argc, char *argv[]) #include #include -#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"; @@ -527,7 +521,7 @@ err: } #if 0 -static void MS_CALLBACK cb(int p, int n, void *arg) +static void cb(int p, int n, void *arg) { char c='*'; diff --git a/crypto/lock.c b/crypto/lock.c index b716708303..4e6b3b7e96 100644 --- a/crypto/lock.c +++ b/crypto/lock.c @@ -117,7 +117,7 @@ #include "cryptlib.h" #include -#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 @@ -182,15 +182,15 @@ static STACK_OF(OPENSSL_STRING) *app_locks=NULL; 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) @@ -198,7 +198,7 @@ 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. diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c index 748292550d..031246055b 100644 --- a/crypto/rsa/rsa_sign.c +++ b/crypto/rsa/rsa_sign.c @@ -261,7 +261,7 @@ int int_rsa_verify(int dtype, const unsigned char *m, (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 } diff --git a/crypto/thr_id.c b/crypto/thr_id.c index 8de903326f..76eb0f0aeb 100644 --- a/crypto/thr_id.c +++ b/crypto/thr_id.c @@ -117,9 +117,9 @@ #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 @@ -195,9 +195,7 @@ void CRYPTO_THREADID_current(CRYPTO_THREADID *id) } #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' */ @@ -237,9 +235,7 @@ unsigned long CRYPTO_thread_id(void) 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; diff --git a/crypto/threads/mttest.c b/crypto/threads/mttest.c index 8de4ff0810..9decb751db 100644 --- a/crypto/threads/mttest.c +++ b/crypto/threads/mttest.c @@ -93,7 +93,6 @@ #include #ifdef OPENSSL_NO_FP_API -#define APPS_WIN16 #include "../buffer/bss_file.c" #endif diff --git a/crypto/txt_db/txt_db.c b/crypto/txt_db/txt_db.c index 6f2ce3b5a4..773589c412 100644 --- a/crypto/txt_db/txt_db.c +++ b/crypto/txt_db/txt_db.c @@ -156,7 +156,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num) *(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; @@ -165,7 +165,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num) 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; @@ -177,7 +177,7 @@ err: 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) diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index 72d85eefcd..2031b66518 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -155,13 +155,6 @@ # endif #endif -#ifdef WIN16TTY -# undef OPENSSL_SYS_WIN16 -# undef WIN16 -# undef _WINDOWS -# include -#endif - /* 06-Apr-92 Luke Brennan Support for VMS */ #include "ui_locl.h" #include "cryptlib.h" @@ -301,13 +294,13 @@ static FILE *tty_in, *tty_out; 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); @@ -393,7 +386,7 @@ static int read_string(UI *ui, UI_STRING *uis) } -#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) { @@ -416,7 +409,7 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl) 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; @@ -582,7 +575,7 @@ static int close_console(UI *ui) } -#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) { @@ -668,7 +661,7 @@ static void recsig(int i) #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; @@ -683,9 +676,7 @@ static int noecho_fgets(char *buf, int size, FILE *tty) break; } size--; -#ifdef WIN16TTY - i=_inchar(); -#elif defined(_WIN32) +#if defined(_WIN32) i=_getch(); #else i=getch(); diff --git a/demos/selfsign.c b/demos/selfsign.c index 68904c611e..f306d8d8a4 100644 --- a/demos/selfsign.c +++ b/demos/selfsign.c @@ -42,15 +42,7 @@ int main() 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; diff --git a/e_os.h b/e_os.h index c6ca774b1a..5c8842ae17 100644 --- a/e_os.h +++ b/e_os.h @@ -185,14 +185,6 @@ extern "C" { #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 diff --git a/ssl/s3_both.c b/ssl/s3_both.c index 4e698bd637..72521531bd 100644 --- a/ssl/s3_both.c +++ b/ssl/s3_both.c @@ -183,12 +183,6 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) 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; } diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 14a4a6e914..fcaaa7bf70 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3441,7 +3441,7 @@ void ssl3_clear(SSL *s) } #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) ; } diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index f9f91e666c..b17a3ed848 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -3602,10 +3602,6 @@ void *SSL_CTX_get0_security_ex_data(const SSL_CTX *ctx) 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, diff --git a/ssl/ssltest.c b/ssl/ssltest.c index 81292591d6..c3684c37ec 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -217,12 +217,12 @@ #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 { @@ -260,7 +260,7 @@ typedef struct srp_client_arg_st #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); @@ -274,7 +274,7 @@ typedef struct srp_server_arg_st 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; @@ -2650,7 +2650,7 @@ static int get_proxy_auth_ex_data_idx(void) 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]; @@ -3025,7 +3025,7 @@ static int process_proxy_cond(unsigned int letters[26], 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; @@ -3119,7 +3119,7 @@ static int MS_CALLBACK app_verify_callback(X509_STORE_CTX *ctx, void *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) diff --git a/util/mkdef.pl b/util/mkdef.pl index 009d132247..e5063b028a 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -72,7 +72,6 @@ my $VMSVAX=0; 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 @@ -81,7 +80,7 @@ my $safe_stack_def = 0; 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", @@ -155,7 +154,7 @@ foreach (@ARGV, split(/ /, $options)) { $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; @@ -260,15 +259,10 @@ if (!$libname) { } # 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"; @@ -841,10 +835,9 @@ sub do_defs } 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);"; @@ -859,10 +852,9 @@ sub do_defs } 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 .= @@ -874,10 +866,9 @@ sub do_defs 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 .= @@ -1014,7 +1005,7 @@ sub do_defs # 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"; @@ -1161,14 +1152,13 @@ sub is_valid 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") { @@ -1314,8 +1304,6 @@ sub print_def_file 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 @@ -1340,19 +1328,6 @@ LIBRARY $libname $liboptions 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); -- 2.34.1