Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,7 +1,7 @@ dnl Define ourselves -AC_INIT(tcltls, 1.8.0) +AC_INIT([tcltls],[1.8.0]) dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL @@ -251,6 +251,7 @@ WEAKENSYMS=':' REMOVESYMS=':' fi dnl Produce output -AC_OUTPUT(Makefile pkgIndex.tcl tcltls.syms) +AC_CONFIG_FILES([Makefile pkgIndex.tcl tcltls.syms]) +AC_OUTPUT Index: tls.c ================================================================== --- tls.c +++ tls.c @@ -36,32 +36,32 @@ #define F2N( key, dsp) \ (((key) == NULL) ? (char *) NULL : \ Tcl_TranslateFileName(interp, (key), (dsp))) #define REASON() ERR_reason_error_string(ERR_get_error()) -static void InfoCallback(CONST SSL *ssl, int where, int ret); +static void InfoCallback(const SSL *ssl, int where, int ret); static int CiphersObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int HandshakeObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int ImportObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int StatusObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int VersionObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int MiscObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int UnimportObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static SSL_CTX *CTX_Init(State *statePtr, int isServer, int proto, char *key, char *certfile, unsigned char *key_asn1, unsigned char *cert_asn1, int key_asn1_len, int cert_asn1_len, char *CAdir, char *CAfile, char *ciphers, char *DHparams); @@ -169,11 +169,11 @@ * Side effects: * Calls callback (if defined) *------------------------------------------------------------------- */ static void -InfoCallback(CONST SSL *ssl, int where, int ret) +InfoCallback(const SSL *ssl, int where, int ret) { State *statePtr = (State*)SSL_get_app_data((SSL *)ssl); Tcl_Obj *cmdPtr; char *major; char *minor; @@ -226,11 +226,11 @@ if (where & (SSL_CB_LOOP|SSL_CB_EXIT)) { Tcl_ListObjAppendElement( statePtr->interp, cmdPtr, Tcl_NewStringObj( SSL_state_string_long(ssl), -1) ); } else if (where & SSL_CB_ALERT) { - CONST char *cp = (char *) SSL_alert_desc_string_long(ret); + const char *cp = (char *) SSL_alert_desc_string_long(ret); Tcl_ListObjAppendElement( statePtr->interp, cmdPtr, Tcl_NewStringObj( cp, -1) ); } else { Tcl_ListObjAppendElement( statePtr->interp, cmdPtr, @@ -495,13 +495,13 @@ static int CiphersObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used. */ Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { - static CONST84 char *protocols[] = { + static const char *protocols[] = { "ssl2", "ssl3", "tls1", "tls1.1", "tls1.2", "tls1.3", NULL }; enum protocol { TLS_SSL2, TLS_SSL3, TLS_TLS1, TLS_TLS1_1, TLS_TLS1_2, TLS_TLS1_3, TLS_NONE }; @@ -635,14 +635,14 @@ * May force SSL negotiation to take place. * *------------------------------------------------------------------- */ -static int HandshakeObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +static int HandshakeObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Channel chan; /* The channel to set a mode on. */ State *statePtr; /* client state for ssl socket */ - CONST char *errStr = NULL; + const char *errStr = NULL; int ret = 1; int err = 0; dprintf("Called"); @@ -724,11 +724,11 @@ static int ImportObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used. */ Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { Tcl_Channel chan; /* The channel to set a mode on. */ State *statePtr; /* client state for ssl socket */ SSL_CTX *ctx = NULL; Tcl_Obj *script = NULL; @@ -964,11 +964,11 @@ /* * SSL Callbacks */ - SSL_set_app_data(statePtr->ssl, (VOID *)statePtr); /* point back to us */ + SSL_set_app_data(statePtr->ssl, (void *)statePtr); /* point back to us */ SSL_set_verify(statePtr->ssl, verify, VerifyCallback); SSL_CTX_set_info_callback(statePtr->ctx, InfoCallback); @@ -1014,11 +1014,11 @@ static int UnimportObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used. */ Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { Tcl_Channel chan; /* The channel to set a mode on. */ dprintf("Called"); @@ -1209,11 +1209,11 @@ SSL_CTX_set_min_proto_version (ctx, TLS1_3_VERSION); SSL_CTX_set_max_proto_version (ctx, TLS1_3_VERSION); } #endif - SSL_CTX_set_app_data( ctx, (VOID*)interp); /* remember the interpreter */ + SSL_CTX_set_app_data( ctx, (void*)interp); /* remember the interpreter */ SSL_CTX_set_options( ctx, SSL_OP_ALL); /* all SSL bug workarounds */ SSL_CTX_set_options( ctx, off); /* all SSL bug workarounds */ SSL_CTX_sess_set_cache_size( ctx, 128); if (ciphers != NULL) @@ -1401,11 +1401,11 @@ static int StatusObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used. */ Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { State *statePtr; X509 *peer; Tcl_Obj *objPtr; Tcl_Channel chan; @@ -1495,11 +1495,11 @@ static int VersionObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used. */ Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { Tcl_Obj *objPtr; dprintf("Called"); @@ -1528,13 +1528,13 @@ static int MiscObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used. */ Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { - static CONST84 char *commands [] = { "req", NULL }; + static const char *commands [] = { "req", NULL }; enum command { C_REQ, C_DUMMY }; int cmd; dprintf("Called"); Index: tlsBIO.c ================================================================== --- tlsBIO.c +++ tlsBIO.c @@ -29,16 +29,16 @@ /* * Forward declarations */ -static int BioWrite _ANSI_ARGS_((BIO *h, CONST char *buf, int num)); -static int BioRead _ANSI_ARGS_((BIO *h, char *buf, int num)); -static int BioPuts _ANSI_ARGS_((BIO *h, CONST char *str)); -static long BioCtrl _ANSI_ARGS_((BIO *h, int cmd, long arg1, void *ptr)); -static int BioNew _ANSI_ARGS_((BIO *h)); -static int BioFree _ANSI_ARGS_((BIO *h)); +static int BioWrite (BIO *h, const char *buf, int num); +static int BioRead (BIO *h, char *buf, int num); +static int BioPuts (BIO *h, const char *str); +static long BioCtrl (BIO *h, int cmd, long arg1, void *ptr); +static int BioNew (BIO *h); +static int BioFree (BIO *h); BIO *BIO_new_tcl(State *statePtr, int flags) { BIO *bio; static BIO_METHOD *BioMethods = NULL; #ifdef TCLTLS_SSL_USE_FASTPATH @@ -108,11 +108,11 @@ BIO_set_init(bio, 1); return(bio); } -static int BioWrite(BIO *bio, CONST char *buf, int bufLen) { +static int BioWrite(BIO *bio, const char *buf, int bufLen) { Tcl_Channel chan; int ret; int tclEofChan, tclErrno; chan = Tls_GetParent((State *) BIO_get_data(bio), 0); @@ -212,11 +212,11 @@ dprintf("BioRead(%p, , %d) [%p] returning %i", (void *) bio, bufLen, (void *) chan, ret); return(ret); } -static int BioPuts(BIO *bio, CONST char *str) { +static int BioPuts(BIO *bio, const char *str) { dprintf("BioPuts(%p, ) called", bio, str); return BioWrite(bio, str, (int) strlen(str)); } Index: tlsIO.c ================================================================== --- tlsIO.c +++ tlsIO.c @@ -20,22 +20,22 @@ #include "tlsInt.h" /* * Forward declarations */ -static int TlsBlockModeProc _ANSI_ARGS_((ClientData instanceData, int mode)); -static int TlsCloseProc _ANSI_ARGS_((ClientData instanceData, Tcl_Interp *interp)); -static int TlsInputProc _ANSI_ARGS_((ClientData instanceData, char *buf, int bufSize, int *errorCodePtr)); -static int TlsOutputProc _ANSI_ARGS_((ClientData instanceData, CONST char *buf, int toWrite, int *errorCodePtr)); -static int TlsGetOptionProc _ANSI_ARGS_((ClientData instanceData, Tcl_Interp *interp, CONST84 char *optionName, Tcl_DString *dsPtr)); -static void TlsWatchProc _ANSI_ARGS_((ClientData instanceData, int mask)); -static int TlsGetHandleProc _ANSI_ARGS_((ClientData instanceData, int direction, ClientData *handlePtr)); -static int TlsNotifyProc _ANSI_ARGS_((ClientData instanceData, int mask)); +static int TlsBlockModeProc (ClientData instanceData, int mode); +static int TlsCloseProc (ClientData instanceData, Tcl_Interp *interp); +static int TlsInputProc (ClientData instanceData, char *buf, int bufSize, int *errorCodePtr); +static int TlsOutputProc (ClientData instanceData, const char *buf, int toWrite, int *errorCodePtr); +static int TlsGetOptionProc (ClientData instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); +static void TlsWatchProc (ClientData instanceData, int mask); +static int TlsGetHandleProc (ClientData instanceData, int direction, ClientData *handlePtr); +static int TlsNotifyProc (ClientData instanceData, int mask); #if 0 -static void TlsChannelHandler _ANSI_ARGS_((ClientData clientData, int mask)); +static void TlsChannelHandler (ClientData clientData, int mask); #endif -static void TlsChannelHandlerTimer _ANSI_ARGS_((ClientData clientData)); +static void TlsChannelHandlerTimer (ClientData clientData); /* * TLS Channel Type */ static Tcl_ChannelType *tlsChannelType = NULL; @@ -78,11 +78,11 @@ * against an older variant. */ size = sizeof(Tcl_ChannelType); /* Base size */ tlsChannelType = (Tcl_ChannelType *) ckalloc(size); - memset((VOID *) tlsChannelType, 0, size); + memset(tlsChannelType, 0, size); /* * Common elements of the structure (no changes in location or name) * close2Proc, seekProc, setOptionProc stay NULL. */ @@ -104,11 +104,11 @@ * For the 8.3.2 core we present ourselves as a version 2 * driver. This means a special value in version (ex * blockModeProc), blockModeProc in a different place and of * course usage of the handlerProc. */ - tlsChannelType->version = TCL_CHANNEL_VERSION_2; + tlsChannelType->version = TCL_CHANNEL_VERSION_5; tlsChannelType->blockModeProc = TlsBlockModeProc; tlsChannelType->handlerProc = TlsNotifyProc; } return(tlsChannelType); @@ -499,11 +499,11 @@ * Writes output on the output device of the channel. * *------------------------------------------------------------------- */ -static int TlsOutputProc(ClientData instanceData, CONST char *buf, int toWrite, int *errorCodePtr) { +static int TlsOutputProc(ClientData instanceData, const char *buf, int toWrite, int *errorCodePtr) { unsigned long backingError; State *statePtr = (State *) instanceData; int written, err; int tlsConnect; @@ -641,11 +641,11 @@ *------------------------------------------------------------------- */ static int TlsGetOptionProc(ClientData instanceData, /* Socket state. */ Tcl_Interp *interp, /* For errors - can be NULL. */ - CONST84 char *optionName, /* Name of the option to + const char *optionName, /* Name of the option to * retrieve the value for, or * NULL to get all options and * their values. */ Tcl_DString *dsPtr) /* Where to store the computed value * initialized by caller. */ Index: tlsInt.h ================================================================== --- tlsInt.h +++ tlsInt.h @@ -27,15 +27,10 @@ #define WIN32_LEAN_AND_MEAN #include #include /* OpenSSL needs this on Windows */ #endif -/* Handle tcl8.3->tcl8.4 CONST changes */ -#ifndef CONST84 -#define CONST84 -#endif - #ifdef NO_PATENTS # define NO_IDEA # define NO_RC2 # define NO_RC4 # define NO_RC5