diff --git a/CMakeLists.txt b/CMakeLists.txt index 29e9b02..cc6e9f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,12 @@ else() ) endif() +# Unix domain sockets off: NO_UN also undefines WITH_UN if it arrives from +# elsewhere, e.g. CFLAGS +if(NOT 3PROXY_USE_UNIX_SOCKETS) + add_compile_definitions(NO_UN) +endif() + # Common definitions if(WIN32) # Windows: use WSAPOLL diff --git a/Makefile.watcom b/Makefile.watcom index 1ea8141..bfe1843 100644 --- a/Makefile.watcom +++ b/Makefile.watcom @@ -8,7 +8,7 @@ BUILDDIR = ../bin/ PREFIX = 3proxy_ CRYPT_PREFIX = 3proxy_ CC = cl -CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "SCNx64=\"I64x\"" /D "SCNd64=\"I64d\"" /D "PRIx64=\"I64x\"" /c $(VERSION) $(BUILDDATE) +CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NO_UN" /D "NODEBUG" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "SCNx64=\"I64x\"" /D "SCNd64=\"I64d\"" /D "PRIx64=\"I64x\"" /c $(VERSION) $(BUILDDATE) COUT = /Fo LN = link LDFLAGS = /nologo /subsystem:console /incremental:no diff --git a/src/acl.c b/src/acl.c index 53a51ae..e02d64b 100644 --- a/src/acl.c +++ b/src/acl.c @@ -99,7 +99,7 @@ int ACLmatches(struct ace* acentry, struct clientparam * param){ ntohs(*SAPORT(¶m->req)) <= portentry->endport) { break; } - if(!portentry) return 0; + if(!portentry) return 0; } if(acentry->wdays){ if(!(acentry -> wdays & wday)) return 0; @@ -110,7 +110,7 @@ int ACLmatches(struct ace* acentry, struct clientparam * param){ if(start_time >= periodentry->fromtime && start_time < periodentry->totime){ break; } - if(!periodentry) return 0; + if(!periodentry) return 0; } if(acentry->users){ for(userentry = acentry->users; userentry; userentry = userentry->next) diff --git a/src/auth.c b/src/auth.c index d591f49..33bef3b 100644 --- a/src/auth.c +++ b/src/auth.c @@ -80,7 +80,7 @@ int cacheauth(struct clientparam * param){ ((type & 4) && !param->password) || ( (type & 1) && *SAFAMILY(¶m->sincr) != AF_INET -#ifndef NOIPv6 +#ifndef NOIPV6 && *SAFAMILY(¶m->sincr) != AF_INET6 #endif ) || (!hashresolv(&auth_table, param, &ac, &ttl))) { @@ -108,7 +108,6 @@ int cacheauth(struct clientparam * param){ int doauth(struct clientparam * param){ int res = 0; struct auth *authfuncs; - char * tmp; int ret = 0; for(authfuncs=param->srv->authfuncs; authfuncs; authfuncs=authfuncs->next){ @@ -125,7 +124,7 @@ int doauth(struct clientparam * param){ ac.username[63] = 0; } if(*SAFAMILY(¶m->sincr) == AF_INET -#ifndef NOIPv6 +#ifndef NOIPV6 || *SAFAMILY(¶m->sincr) == AF_INET6 #endif ) { @@ -134,7 +133,7 @@ int doauth(struct clientparam * param){ } if(*SAFAMILY(¶m->sinsl) == AF_INET -#ifndef NOIPv6 +#ifndef NOIPV6 || *SAFAMILY(¶m->sinsl) == AF_INET6 #endif ) { @@ -235,7 +234,6 @@ static int ctstrcmp(const char *a, const char *b, size_t maxlen){ } int strongauth(struct clientparam * param){ - static char dummy; unsigned char buf[256]; char pass[256] = {0}; diff --git a/src/authradius.c b/src/authradius.c index 592441e..1234596 100644 --- a/src/authradius.c +++ b/src/authradius.c @@ -174,17 +174,6 @@ void md5_calc(unsigned char *output, unsigned char *input, unsigned int inputlen); -char *strNcpy(char *dest, const char *src, int n) -{ - if (n > 0) - strncpy(dest, src, n); - else - n = 1; - dest[n - 1] = 0; - - return dest; -} - void md5_calc(unsigned char *output, unsigned char *input, unsigned int inlen) { @@ -308,14 +297,12 @@ int radsend(struct clientparam * param, int auth, int stop){ unsigned char *ptr; int total_length; int len; - int op; PROXYSOCKADDRTYPE saremote; struct pollfd fds[1]; char vector[AUTH_VECTOR_LEN]; radius_packet_t packet, rpacket; SASIZETYPE salen; int data_len; - uint8_t *vendor_len; int count=0; uint8_t *attr; long vendor=0; @@ -613,7 +600,6 @@ int radsend(struct clientparam * param, int auth, int stop){ attr = rpacket.data; count = total_length - 20; - vendor_len = 0; while (count >= 2) { if (!vendor && attr[0] == 0) { diff --git a/src/auto.c b/src/auto.c index ddf9e2c..e3dd5b8 100644 --- a/src/auto.c +++ b/src/auto.c @@ -21,6 +21,7 @@ void * autochild(struct clientparam* param) { if (len != 1){ param->res = 801; dolog(param, (unsigned char *)""); + return 0; } if(*param->clibuf == 4 || *param->clibuf == 5) { param->service = S_SOCKS; diff --git a/src/common.c b/src/common.c index 735827e..2c118bf 100644 --- a/src/common.c +++ b/src/common.c @@ -681,20 +681,6 @@ int doconnect(struct clientparam * param){ setopts(param->remsock, param->srv->srvsockopts); param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg)); -#ifdef REUSE - { - int opt; - -#ifdef SO_REUSEADDR - opt = 1; - param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int)); -#endif -#ifdef SO_REUSEPORT - opt = 1; - param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_REUSEPORT, (unsigned char *)&opt, sizeof(int)); -#endif - } -#endif #if defined SO_BINDTODEVICE if(param->srv->obindtodevice) { if(param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_BINDTODEVICE, param->srv->obindtodevice, strlen(param->srv->obindtodevice) + 1)) diff --git a/src/conf.c b/src/conf.c index b8c74e2..9f32070 100644 --- a/src/conf.c +++ b/src/conf.c @@ -296,6 +296,7 @@ static int h_external(int argc, unsigned char ** argv){ else conf.extsa6 = sa6; #else res = getip46(46, argv[1], (struct sockaddr *)&conf.extsa); + if(!res) return 1; #endif return 0; } @@ -517,7 +518,6 @@ static int h_auth(int argc, unsigned char **argv){ } static int h_users(int argc, unsigned char **argv){ - static char dummy; int j; unsigned char *arg; char *pw[2]; diff --git a/src/datatypes.c b/src/datatypes.c index 5bcda2b..6f348e5 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -61,13 +61,6 @@ static void pr_ip(struct node *node, CBFUNC cbf, void*cb){ if(node->value)(*cbf)(cb, buf, myinet_ntop(AF_INET, node -> value, buf, 4)); } -#ifndef NOIPV6 -static void pr_ip6(struct node *node, CBFUNC cbf, void*cb){ - char buf[64]; - if(node->value)(*cbf)(cb, buf, myinet_ntop(AF_INET6, node -> value, buf, 16)); -} -#endif - static void pr_sa(struct node *node, CBFUNC cbf, void*cb){ #ifdef NOIPV6 if(node->value)pr_ip(node, cbf, cb); diff --git a/src/hash.c b/src/hash.c index 50ca93a..9877428 100644 --- a/src/hash.c +++ b/src/hash.c @@ -36,7 +36,6 @@ void destroyhashtable(struct hashtable *ht){ int inithashtable(struct hashtable *ht, unsigned tablesize, unsigned poolsize, unsigned growlimit){ unsigned i; - clock_t c; #ifdef _WIN32 struct timeb tb; @@ -48,7 +47,6 @@ int inithashtable(struct hashtable *ht, unsigned tablesize, unsigned poolsize, u struct timezone tz; gettimeofday(&tb, &tz); #endif - c = clock(); if(tablesize < 2 || poolsize < tablesize || growlimit < poolsize) return 1; if(ht->ihashtable){ @@ -169,7 +167,6 @@ static void hashgrow(struct hashtable *ht){ void hashadd(struct hashtable *ht, void* name, void* value, time_t expires){ uint32_t hen, he; uint32_t *hep; - int overwrite = 0; uint8_t hash[MAX_HASH_SIZE]; uint32_t index; uint32_t last = 0; diff --git a/src/hashtables.c b/src/hashtables.c index 52aa880..4a7563d 100644 --- a/src/hashtables.c +++ b/src/hashtables.c @@ -28,7 +28,7 @@ static void param2hash_add(const struct hashtable *ht, void *index, uint8_t *has void param2hash_search(const struct hashtable *ht, void *index, uint8_t *hash){ struct clientparam *param = (struct clientparam *)index; unsigned type = param->srv->authcachetype; - int len = 0, oplen = 0, acllen = 0, ulen = 0, plen = 0, hlen = 0, a1len = 0, a2len = 0, a3len = 0, p1len=0, p2len = 0; + int oplen = 0, acllen = 0, ulen = 0, plen = 0, hlen = 0, a1len = 0, a2len = 0, a3len = 0, p1len=0, p2len = 0; if((type & 2) && param->username) ulen = strlen((const char *)param->username) + 1; @@ -76,19 +76,6 @@ void param2hash_search(const struct hashtable *ht, void *index, uint8_t *hash){ memcpy(param->hash, hash, ht->hash_size); } -static void udpparam2hash(const struct hashtable *ht, void *index, uint8_t *hash){ - struct clientparam *param = (struct clientparam *)index; - mdh_ctx *bctx = mdh_init(MDH_BLAKE2, ht->hash_size); - unsigned int blen = ht->hash_size; - if(!bctx) return; - mdh_update(bctx, SAADDR(¶m->srv->intsa), SAADDRLEN(¶m->srv->intsa)); - mdh_update(bctx, SAPORT(¶m->srv->intsa), 2); - mdh_update(bctx, SAADDR(¶m->sincr), SAADDRLEN(¶m->sincr)); - mdh_update(bctx, SAPORT(¶m->sincr), 2); - mdh_final(bctx, hash, &blen); - mdh_free(bctx); -} - struct hashtable dns_table = {char_index2hash, char_index2hash, 4, 32}; struct hashtable dns6_table = {char_index2hash, char_index2hash, 16, 32}; struct hashtable auth_table = {param2hash_add, param2hash_search, sizeof(struct authcache), 64}; diff --git a/src/plugins/FilePlugin/FilePlugin.c b/src/plugins/FilePlugin/FilePlugin.c index d211811..fc07e50 100644 --- a/src/plugins/FilePlugin/FilePlugin.c +++ b/src/plugins/FilePlugin/FilePlugin.c @@ -52,7 +52,6 @@ unsigned long preview = 0; char path[300]; static int counter = 0; -static int timeo = 0; static char * fp_stringtable[] = { /* 0 */ "HTTP/1.0 503 Service Unavailable\r\n" @@ -261,10 +260,6 @@ static void removefps(struct fp_stream * fps){ fps->state = 0; } -static int WINAPI fp_connect(SOCKET s, const struct sockaddr *name, fp_size_t namelen){ - return sso._connect(sso.state, s, name, namelen); -} - void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){ struct fp_callback *cb; int state; diff --git a/src/plugins/PamAuth/pamauth.c b/src/plugins/PamAuth/pamauth.c index d4f3791..2430bd4 100644 --- a/src/plugins/PamAuth/pamauth.c +++ b/src/plugins/PamAuth/pamauth.c @@ -90,10 +90,7 @@ static int pamfunc(struct clientparam *param) conv.appdata_ptr = (char *) param->password; _3proxy_mutex_lock(&pam_mutex); - if (!pamh) - { - retval = pam_start ((char *)service, (char *)param->username, &conv, &pamh); - } + retval = pam_start ((char *)service, (char *)param->username, &conv, &pamh); if (retval == PAM_SUCCESS) retval = pam_set_item (pamh, PAM_USER, param->username); /*fprintf(stderr,"pam_set_item1 rc=%d\n",retval);*/ diff --git a/src/plugins/TransparentPlugin/transparent_plugin.c b/src/plugins/TransparentPlugin/transparent_plugin.c index 7bf9ee8..d22b352 100644 --- a/src/plugins/TransparentPlugin/transparent_plugin.c +++ b/src/plugins/TransparentPlugin/transparent_plugin.c @@ -34,13 +34,12 @@ static void* transparent_filter_open(void * idata, struct srvparam * param){ static FILTER_ACTION transparent_filter_client(void *fo, struct clientparam * param, void** fc){ - socklen_t len; char addrbuf[64]; - int i=0; - - len = sizeof(param->req); #ifdef WITH_NETFILTER + socklen_t len; + + len = sizeof(param->req); #ifdef SO_ORIGINAL_DST if(getsockopt(param->clisock, diff --git a/src/proxy.c b/src/proxy.c index f8669cb..ff90509 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -247,9 +247,13 @@ void * proxychild(struct clientparam* param) { int redirect = 0; int prefix = 0, ckeepalive=0; int ftp = 0; +#ifndef ANONYMOUS int anonymous; +#endif int sleeptime = 0; +#ifndef WITHMAIN int reqsize, reqbufsize; +#endif int authenticate; struct pollfd fds[2]; SOCKET ftps; @@ -265,7 +269,9 @@ void * proxychild(struct clientparam* param) { if(param->remsock != INVALID_SOCKET) haveconnection = 1; if(!(buf = malloc(BUFSIZE))) {RETURN(21);} bufsize = BUFSIZE; +#ifndef ANONYMOUS anonymous = param->srv->anonymous; +#endif for(;;){ memset(buf, 0, bufsize); inbuf = 0; @@ -548,8 +554,10 @@ for(;;){ buf[inbuf] = 0; +#ifndef WITHMAIN reqsize = (int)strlen((char *)req); reqbufsize = reqsize + 1; +#endif if(param->srv->needuser > 1 && !param->username) {RETURN(4);} @@ -701,7 +709,6 @@ for(;;){ int sizetoken =-1; int modetoken =-1; int datetoken =-1; - int spaces = 1; unsigned char * tokens[10]; unsigned wordlen [10]; unsigned char j=0; @@ -734,7 +741,6 @@ for(;;){ wordlen[datetoken] = ((unsigned)(tokens[1] - tokens[0])) + wordlen[1]; sizetoken = 2; filetoken = 3; - spaces = 10; } else { if(j < 8 || wordlen[0]!=10) continue; diff --git a/src/proxy.h b/src/proxy.h index ad7f2d4..17c3875 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -103,7 +103,6 @@ #include #ifndef PTHREAD_STACK_MIN #define PTHREAD_STACK_MIN 32768 -#define sockerror strerror #endif void daemonize(void); #define SLEEPTIME 1000 diff --git a/src/proxymain.c b/src/proxymain.c index 298e308..4e3ba86 100644 --- a/src/proxymain.c +++ b/src/proxymain.c @@ -165,9 +165,6 @@ struct socketoptions sockopts[] = { #ifdef TCP_TIMESTAMPS {TCP_TIMESTAMPS, "TCP_TIMESTAMPS"}, #endif -#ifdef USE_TCP_FASTOPEN - {USE_TCP_FASTOPEN, "USE_TCP_FASTOPEN"}, -#endif #ifdef SO_REUSEADDR {SO_REUSEADDR, "SO_REUSEADDR"}, #endif @@ -297,6 +294,7 @@ int MODULEMAINFUNC (int argc, char** argv){ #ifdef __linux__ int saved_nsfd = -1; #endif +#if !defined(PORTMAP) || !defined(NOPORTMAP) char loghelp[] = #ifdef STDMAIN #ifndef _WIN32 @@ -312,8 +310,8 @@ int MODULEMAINFUNC (int argc, char** argv){ " -Di(DEVICENAME) bind internal interface to device, e.g. eth1\n" " -De(DEVICENAME) bind external interface to device, e.g. eth1\n" #endif -#ifdef WITHSLICE - " -s Use slice() - faster proxing, but no filtering for data\n" +#ifdef WITHSPLICE + " -s Use splice() - faster proxing, but no filtering for data\n" #endif "-g(GRACE_TRAFF,GRACE_NUM,GRACE_DELAY) - delay GRACE_DELAY milliseconds before polling if average polling size below GRACE_TRAFF bytes and GRACE_NUM read operations in single directions are detected within 1 second to minimize polling\n" " -fFORMAT logging format (see documentation)\n" @@ -335,6 +333,7 @@ int MODULEMAINFUNC (int argc, char** argv){ " to-client (oc), to-server (os), listening (ol) socket, connect back client\n" " (or) socket, connect back server (oR) listening socket\n" " where possible options are: "; +#endif #ifdef _WIN32 unsigned long ul = 1; diff --git a/src/smtpp.c b/src/smtpp.c index 0dca700..a2f449d 100644 --- a/src/smtpp.c +++ b/src/smtpp.c @@ -56,7 +56,10 @@ int readreply (struct clientparam* param) { int readcommand (struct clientparam* param) { unsigned char * buf; - int res, i, bufsize = 320; + int i, bufsize = 320; +#ifndef WITHMAIN + int res; +#endif int ret = 1; if(!(buf = malloc(bufsize))) return 0; @@ -82,7 +85,10 @@ int readcommand (struct clientparam* param) { int readdata (struct clientparam* param) { unsigned char * buf; - int res, i, bufsize = 4096; + int i, bufsize = 4096; +#ifndef WITHMAIN + int res; +#endif if(!(buf = malloc(bufsize))) return 0; while ((i = sockgetlinebuf(param, CLIENT, buf, bufsize-1, '\n', conf.timeouts[STRING_L])) > 0 && !(i==3 && buf[0] == '.')){ diff --git a/src/sockmap.c b/src/sockmap.c index 24ff59f..0ec80b9 100644 --- a/src/sockmap.c +++ b/src/sockmap.c @@ -14,7 +14,7 @@ #if WITHLOG > 1 char logbuf[1024]; #endif -#define log(X) dolog(param,X) +#define log(X) dolog(param,(const unsigned char *)(X)) #else #define log(X) #endif @@ -47,13 +47,15 @@ ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t le int sockmap(struct clientparam * param, int timeo, int usesplice){ uint64_t fromclient=0x7fffffffffffffff, fromserver =0x7fffffffffffffff; uint64_t inclientbuf = 0, inserverbuf = 0; - int FROMCLIENT = 1, TOCLIENTBUF = 1, FROMCLIENTBUF = 1, TOSERVER = 1, - FROMSERVER = 1, TOSERVERBUF = 1, FROMSERVERBUF = 1, TOCLIENT = 1; + int FROMCLIENT = 1, TOCLIENTBUF = 1, TOSERVER = 1, + FROMSERVER = 1, TOSERVERBUF = 1, TOCLIENT = 1; +#if WITHLOG > 1 + int FROMCLIENTBUF = 1, FROMSERVERBUF = 1; +#endif int HASERROR=0; int CLIENTTERMREAD = 0, CLIENTTERMWRITE = 0, SERVERTERMREAD = 0, SERVERTERMWRITE = 0; int after = 0; struct pollfd fds[8]; - struct pollfd *fdsp = fds; int fdsc = 0; int sleeptime = 0; FILTER_ACTION action; diff --git a/src/socks.c b/src/socks.c index 99c6624..1874745 100644 --- a/src/socks.c +++ b/src/socks.c @@ -53,7 +53,6 @@ void * sockschild(struct clientparam* param) { int ver=0; int havepass = 0; PROXYSOCKADDRTYPE sin; - int len; param->service = S_SOCKS; @@ -212,19 +211,7 @@ void * sockschild(struct clientparam* param) { param->operation = command == 2?BIND:UDPASSOC; if(command == 2){ if ((param->remsock=param->srv->so._socket(param->sostate, SASOCK(¶m->req), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN (11);} -#ifdef REUSE - { - int opt; -#ifdef SO_REUSEADDR - opt = 1; - param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_REUSEADDR, (unsigned char *)&opt, sizeof(int)); -#endif -#ifdef SO_REUSEPORT - opt = 1; - param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_REUSEPORT, (unsigned char *)&opt, sizeof(int)); -#endif - } -#endif + setopts(param->remsock, param->srv->lissockopts); } break; diff --git a/src/ssl.c b/src/ssl.c index 5867089..455e07a 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -53,7 +53,6 @@ static char *client_ca_store = NULL; static int mitm = 0; static int serv = 0; static int cli = 0; -static int ssl_inited = 0; static int client_min_proto_version = 0; static int client_max_proto_version = 0; static int server_min_proto_version = 0; @@ -486,10 +485,6 @@ EVP_PKEY * getKey(const char *fname){ return key; } -static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx){ - return preverify_ok; -} - #ifdef WITH_WOLFSSL /* wolfSSL's SSL_CTX_use_PrivateKey(EVP_PKEY*) compat is unreliable: it * silently fails (returns 0, no error queued) for keys loaded via @@ -732,7 +727,7 @@ static void* ssl_filter_open(void * idata, struct srvparam * srv){ #endif else SSL_CTX_set_default_verify_paths(sc->srv_ctx); - SSL_CTX_set_verify(sc->srv_ctx, SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); + SSL_CTX_set_verify(sc->srv_ctx, SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); } #ifdef WITH_WOLFSSL else { diff --git a/src/ssllib.c b/src/ssllib.c index d7442c9..5122e99 100644 --- a/src/ssllib.c +++ b/src/ssllib.c @@ -310,29 +310,8 @@ int thread_setup(void) _3proxy_mutex_init(mutex_buf +i); CRYPTO_set_id_callback(id_function); CRYPTO_set_locking_callback(locking_function); - return 1; -#else - return 1; #endif -} - -int thread_cleanup(void) -{ -#if LEGACY_SSL_THREADING - int i; - - if (!mutex_buf) - return 0; - CRYPTO_set_id_callback(NULL); - CRYPTO_set_locking_callback(NULL); - for (i = 0; i < CRYPTO_num_locks( ); i++) - _3proxy_mutex_destroy(mutex_buf +i); - free(mutex_buf); - mutex_buf = NULL; return 1; -#else - return 1; -#endif } diff --git a/src/structures.h b/src/structures.h index 56a917d..3ebbabe 100644 --- a/src/structures.h +++ b/src/structures.h @@ -182,7 +182,7 @@ int #ifdef WITH_UN #define PROXYSOCKADDRTYPE struct sockaddr_storage #else -#ifndef NOIPv6 +#ifndef NOIPV6 #define PROXYSOCKADDRTYPE struct sockaddr_in6 #else #define PROXYSOCKADDRTYPE struct sockaddr_in @@ -798,7 +798,7 @@ extern struct hashtable udp_table; struct authcache { unsigned char username[64]; -#ifndef NOIPv6 +#ifndef NOIPV6 uint8_t sincr_addr[16]; uint8_t sinsl_addr[16]; #else diff --git a/src/tlspr.c b/src/tlspr.c index bc775cd..44f51c7 100644 --- a/src/tlspr.c +++ b/src/tlspr.c @@ -19,20 +19,6 @@ unsigned size16(unsigned char *buf){ return res; } -int readtls(struct clientparam *param, int direction, unsigned char *buf, int bufsize){ - int res = 0; - int len; - - if(bufsize < 3) return -1; - res = sockgetlinebuf(param, direction, buf, 3, EOF, conf.timeouts[STRING_S]); - if(res !=3 || buf[0] != 22 || buf[1] != 3) return -2; - len = size16(buf+3); - if((len+3) > bufsize) return -3; - res = sockgetlinebuf(param, direction, buf+3, len, EOF, conf.timeouts[STRING_S]); - if(res != len) return -4; - return len+3; -} - #define BSIZE (4096) #define SNILEN (256) #define PROTOLEN (32)